Bug 1521791 - Update cubeb from upstream to 67d37c1. r=padenot

Differential Revision: https://phabricator.services.mozilla.com/D17248

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alex Chronopoulos 2019-01-22 16:09:51 +00:00
Родитель 1e8fb88b12
Коммит 836d8e0a78
5 изменённых файлов: 34 добавлений и 9 удалений

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

@ -400,6 +400,7 @@ TEST(cubeb, basic_stream_operations)
cubeb_stream * stream;
cubeb_stream_params params;
uint64_t position;
uint32_t latency;
r = common_init(&ctx, "test_sanity");
ASSERT_EQ(r, CUBEB_OK);
@ -416,25 +417,34 @@ TEST(cubeb, basic_stream_operations)
ASSERT_EQ(r, CUBEB_OK);
ASSERT_NE(stream, nullptr);
/* position and volume before stream has started */
/* position and latency before stream has started */
r = cubeb_stream_get_position(stream, &position);
ASSERT_EQ(r, CUBEB_OK);
ASSERT_EQ(position, 0u);
r = cubeb_stream_get_latency(stream, &latency);
ASSERT_EQ(r, CUBEB_OK);
r = cubeb_stream_start(stream);
ASSERT_EQ(r, CUBEB_OK);
/* position and volume after while stream running */
/* position and latency after while stream running */
r = cubeb_stream_get_position(stream, &position);
ASSERT_EQ(r, CUBEB_OK);
r = cubeb_stream_get_latency(stream, &latency);
ASSERT_EQ(r, CUBEB_OK);
r = cubeb_stream_stop(stream);
ASSERT_EQ(r, CUBEB_OK);
/* position and volume after stream has stopped */
/* position and latency after stream has stopped */
r = cubeb_stream_get_position(stream, &position);
ASSERT_EQ(r, CUBEB_OK);
r = cubeb_stream_get_latency(stream, &latency);
ASSERT_EQ(r, CUBEB_OK);
cubeb_stream_destroy(stream);
cubeb_destroy(ctx);
}

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

@ -53,12 +53,14 @@ extern "C" {
output_params.format = CUBEB_SAMPLE_FLOAT32NE;
output_params.rate = rate;
output_params.channels = 2;
output_params.layout = CUBEB_LAYOUT_UNDEFINED;
output_params.prefs = CUBEB_STREAM_PREF_NONE;
cubeb_stream_params input_params;
input_params.format = CUBEB_SAMPLE_FLOAT32NE;
input_params.rate = rate;
input_params.channels = 1;
input_params.layout = CUBEB_LAYOUT_UNDEFINED;
input_params.prefs = CUBEB_STREAM_PREF_NONE;
cubeb_stream * stm;
@ -102,7 +104,7 @@ extern "C" {
for (i = 0; i < nframes; ++i) {
for (c = 0; c < 2; ++c) {
buf[i][c] = in[i];
out[i][c] = in[i];
}
}
return nframes;

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

@ -19,5 +19,5 @@ origin:
license: "ISC"
# update.sh will update this value
release: "e5c3a1d8a68c412177f768908b1d54550cf9d510-dirty (2018-11-29 18:20:54 +0100)"
release: "67d37c16be84fcc469531d4b6f70eae8a2867a66 (2019-01-21 14:41:14 +0200)"

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

@ -1834,6 +1834,7 @@ static void audiounit_get_available_samplerate(AudioObjectID devid, AudioObjectP
uint32_t * min, uint32_t * max, uint32_t * def);
static int
audiounit_create_device_from_hwdev(cubeb_device_info * dev_info, AudioObjectID devid, cubeb_device_type type);
static void audiounit_device_destroy(cubeb_device_info * device);
static void
audiounit_workaround_for_airpod(cubeb_stream * stm)
@ -1879,6 +1880,8 @@ audiounit_workaround_for_airpod(cubeb_stream * stm)
LOG("Non fatal error, AudioObjectSetPropertyData/kAudioDevicePropertyNominalSampleRate, rv=%d", rv);
}
}
audiounit_device_destroy(&input_device_info);
audiounit_device_destroy(&output_device_info);
}
/*
@ -3101,7 +3104,7 @@ int audiounit_stream_register_device_changed_callback(cubeb_stream * stream,
auto_lock dev_cb_lock(stream->device_changed_callback_lock);
/* Note: second register without unregister first causes 'nope' error.
* Current implementation requires unregister before register a new cb. */
assert(!stream->device_changed_callback);
assert(!device_changed_callback || !stream->device_changed_callback);
stream->device_changed_callback = device_changed_callback;
return CUBEB_OK;
}
@ -3378,14 +3381,20 @@ audiounit_enumerate_devices(cubeb * /* context */, cubeb_device_type type,
return CUBEB_OK;
}
static void
audiounit_device_destroy(cubeb_device_info * device)
{
delete [] device->device_id;
delete [] device->friendly_name;
delete [] device->vendor_name;
}
static int
audiounit_device_collection_destroy(cubeb * /* context */,
cubeb_device_collection * collection)
{
for (size_t i = 0; i < collection->count; i++) {
delete [] collection->device[i].device_id;
delete [] collection->device[i].friendly_name;
delete [] collection->device[i].vendor_name;
audiounit_device_destroy(&collection->device[i]);
}
delete [] collection->device;

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

@ -947,6 +947,7 @@ pulse_stream_init(cubeb * context,
}
*stream = stm;
LOG("Cubeb stream (%p) init successful.", *stream);
return CUBEB_OK;
}
@ -978,6 +979,7 @@ pulse_stream_destroy(cubeb_stream * stm)
}
WRAP(pa_threaded_mainloop_unlock)(stm->context->mainloop);
LOG("Cubeb stream (%p) destroyed successfully.", stm);
free(stm);
}
@ -1009,6 +1011,7 @@ pulse_stream_start(cubeb_stream * stm)
WRAP(pa_threaded_mainloop_unlock)(stm->context->mainloop);
}
LOG("Cubeb stream (%p) started successfully.", stm);
return CUBEB_OK;
}
@ -1024,6 +1027,7 @@ pulse_stream_stop(cubeb_stream * stm)
WRAP(pa_threaded_mainloop_unlock)(stm->context->mainloop);
stream_cork(stm, CORK | NOTIFY);
LOG("Cubeb stream (%p) stopped successfully.", stm);
return CUBEB_OK;
}