Bug 1864143 - Update libcubeb to revision 54217bca. r=cubeb-reviewers,kinetik

Differential Revision: https://phabricator.services.mozilla.com/D194218
This commit is contained in:
Paul Adenot 2023-11-28 13:43:20 +00:00
Родитель cc81b284c3
Коммит 2efa64207a
8 изменённых файлов: 23 добавлений и 33 удалений

Просмотреть файл

@ -9,8 +9,8 @@ origin:
description: "Cross platform audio library"
url: https://github.com/mozilla/cubeb
license: ISC
release: 30efcd1cdf8a794e918fe2c6e9b74c8ea8bbcdd6 (2023-11-10T16:00:19Z).
revision: 30efcd1cdf8a794e918fe2c6e9b74c8ea8bbcdd6
release: 54217bca3f3e0cd53c073690a23dd25d83557909 (2023-11-21T10:08:34Z).
revision: 54217bca3f3e0cd53c073690a23dd25d83557909
vendoring:
url: https://github.com/mozilla/cubeb

Просмотреть файл

@ -11,7 +11,6 @@
#include "cubeb_resampler.h"
#include "cubeb_triple_buffer.h"
#include <aaudio/AAudio.h>
#include <android/api-level.h>
#include <atomic>
#include <cassert>
#include <chrono>
@ -1757,9 +1756,6 @@ const static struct cubeb_ops aaudio_ops = {
extern "C" /*static*/ int
aaudio_init(cubeb ** context, char const * /* context_name */)
{
if (android_get_device_api_level() <= 30) {
return CUBEB_ERROR;
}
// load api
void * libaaudio = nullptr;
#ifndef DISABLE_LIBAAUDIO_DLOPEN

Просмотреть файл

@ -1891,8 +1891,10 @@ opensl_stream_get_latency(cubeb_stream * stm, uint32_t * latency)
uint32_t stream_latency_frames =
stm->user_output_rate * stm->output_latency_ms / 1000;
return static_cast<int>(stream_latency_frames +
cubeb_resampler_latency(stm->resampler));
*latency = static_cast<int>(stream_latency_frames +
cubeb_resampler_latency(stm->resampler));
return CUBEB_OK;
}
int

Просмотреть файл

@ -47,7 +47,7 @@ single_audiobuffer_init(AudioBuffer * buffer, uint32_t bytesPerFrame,
/** Initialize the ring array.
@param ra The ring_array pointer of allocated structure.
@retval 0 on success. */
int
static int
ring_array_init(ring_array * ra, uint32_t capacity, uint32_t bytesPerFrame,
uint32_t channelsPerFrame, uint32_t framesPerBuffer)
{
@ -79,7 +79,7 @@ ring_array_init(ring_array * ra, uint32_t capacity, uint32_t bytesPerFrame,
/** Destroy the ring array.
@param ra The ring_array pointer.*/
void
static void
ring_array_destroy(ring_array * ra)
{
assert(ra);
@ -98,7 +98,7 @@ ring_array_destroy(ring_array * ra)
@param ra The ring_array pointer.
@retval Pointer of the allocated space to be stored with fresh data or NULL
if full. */
AudioBuffer *
static AudioBuffer *
ring_array_get_free_buffer(ring_array * ra)
{
assert(ra && ra->buffer_array);
@ -119,7 +119,7 @@ ring_array_get_free_buffer(ring_array * ra)
/** Get the next available buffer with data.
@param ra The ring_array pointer.
@retval Pointer of the next in order data buffer or NULL if empty. */
AudioBuffer *
static AudioBuffer *
ring_array_get_data_buffer(ring_array * ra)
{
assert(ra && ra->buffer_array);
@ -139,18 +139,4 @@ ring_array_get_data_buffer(ring_array * ra)
return ret;
}
/** When array is empty get the first allocated buffer in the array.
@param ra The ring_array pointer.
@retval If arrays is empty, pointer of the allocated space else NULL. */
AudioBuffer *
ring_array_get_dummy_buffer(ring_array * ra)
{
assert(ra && ra->buffer_array);
assert(ra->capacity > 0);
if (ra->count > 0) {
return NULL;
}
return &ra->buffer_array[0];
}
#endif // CUBEB_RING_ARRAY_H

Просмотреть файл

@ -181,7 +181,10 @@ run_test_callback(test_direction direction, cubeb_data_callback data_cb,
output_params = input_params;
r = cubeb_get_min_latency(ctx, &input_params, &latency_frames);
ASSERT_EQ(r, CUBEB_OK) << "Could not get minimal latency";
if (r != CUBEB_OK) {
// not fatal
latency_frames = 1024;
}
switch (direction) {
case INPUT_ONLY:

Просмотреть файл

@ -18,8 +18,6 @@
#include <stdio.h>
#include <stdlib.h>
#include "mozilla/gtest/MozHelpers.h"
// #define ENABLE_NORMAL_LOG
// #define ENABLE_VERBOSE_LOG
#include "common.h"
@ -208,8 +206,6 @@ TEST(cubeb, duplex_collection_change_no_unregister)
cubeb * ctx;
int r;
mozilla::gtest::DisableCrashReporter();
r = common_init(&ctx, "Cubeb duplex example with collection change");
ASSERT_EQ(r, CUBEB_OK) << "Error initializing cubeb library";

Просмотреть файл

@ -106,7 +106,10 @@ TEST(cubeb, logging)
output_params.prefs = CUBEB_STREAM_PREF_NONE;
r = cubeb_get_min_latency(ctx, &output_params, &latency_frames);
ASSERT_EQ(r, CUBEB_OK) << "Could not get minimal latency";
if (r != CUBEB_OK) {
// not fatal
latency_frames = 1024;
}
r = cubeb_stream_init(ctx, &stream, "Cubeb logging", NULL, NULL, NULL,
&output_params, latency_frames, data_cb_load, state_cb,

Просмотреть файл

@ -564,7 +564,11 @@ TEST(cubeb, stream_position)
r = cubeb_stream_get_position(stream, &position);
ASSERT_EQ(r, CUBEB_OK);
ASSERT_EQ(position, last_position);
// The OpenSL backend performs client-side interpolation for its position and
// its drain implementation isn't very accurate.
if (strcmp(cubeb_get_backend_id(ctx), "opensl")) {
ASSERT_EQ(position, last_position);
}
cubeb_stream_destroy(stream);
cubeb_destroy(ctx);