Bug 1281402 - Uplift cubeb to revision 9a1d6ccd2. r=kinetik

MozReview-Commit-ID: 36jF493k7XW

--HG--
extra : rebase_source : ce0e2bf4c0a8ae671e0633b17a4339b9bea2e3b8
This commit is contained in:
Paul Adenot 2016-06-22 15:12:58 +02:00
Родитель cc110e7047
Коммит 378278ea83
4 изменённых файлов: 20 добавлений и 20 удалений

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

@ -5,4 +5,4 @@ Makefile.in build files for the Mozilla build system.
The cubeb git repository is: git://github.com/kinetiknz/cubeb.git
The git commit ID used was 073c9f011114fe4208b4aa49e99e33cde1deb6f1.
The git commit ID used was 9a1d6ccd2a0d65bfb985743b927398bcbeb05ad6.

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

@ -1536,6 +1536,7 @@ audiounit_get_devices(AudioObjectID ** devices, uint32_t * count)
}
} else {
*devices = NULL;
ret = -1;
}
return ret;
@ -1598,24 +1599,23 @@ audiounit_get_available_samplerate(AudioObjectID devid, AudioObjectPropertyScope
}
adr.mSelector = kAudioDevicePropertyAvailableNominalSampleRates;
if (AudioObjectHasProperty(devid, &adr)) {
UInt32 size = 0;
AudioValueRange range;
if (AudioObjectGetPropertyDataSize(devid, &adr, 0, NULL, &size) == noErr) {
uint32_t i, count = size / sizeof(AudioValueRange);
AudioValueRange * ranges = malloc(size);
range.mMinimum = 9999999999.0;
range.mMaximum = 0.0;
if (AudioObjectGetPropertyData(devid, &adr, 0, NULL, &size, ranges) == noErr) {
for (i = 0; i < count; i++) {
if (ranges[i].mMaximum > range.mMaximum)
range.mMaximum = ranges[i].mMaximum;
if (ranges[i].mMinimum < range.mMinimum)
range.mMinimum = ranges[i].mMinimum;
}
UInt32 size = 0;
AudioValueRange range;
if (AudioObjectHasProperty(devid, &adr) &&
AudioObjectGetPropertyDataSize(devid, &adr, 0, NULL, &size) == noErr) {
uint32_t i, count = size / sizeof(AudioValueRange);
AudioValueRange * ranges = malloc(size);
range.mMinimum = 9999999999.0;
range.mMaximum = 0.0;
if (AudioObjectGetPropertyData(devid, &adr, 0, NULL, &size, ranges) == noErr) {
for (i = 0; i < count; i++) {
if (ranges[i].mMaximum > range.mMaximum)
range.mMaximum = ranges[i].mMaximum;
if (ranges[i].mMinimum < range.mMinimum)
range.mMinimum = ranges[i].mMinimum;
}
free(ranges);
}
free(ranges);
*max = (uint32_t)range.mMaximum;
*min = (uint32_t)range.mMinimum;
} else {
@ -1839,7 +1839,7 @@ audiounit_get_devices_of_type(cubeb_device_type devtype, AudioObjectID ** devid_
}
}
if (devid_array) {
if (devid_array && dev_count > 0) {
*devid_array = calloc(dev_count, sizeof(AudioObjectID));
assert(*devid_array);
memcpy(*devid_array, &devices_in_scope, dev_count * sizeof(AudioObjectID));

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

@ -1001,7 +1001,7 @@ pulse_ensure_dev_list_data_list_size (pulse_dev_list_data * list_data)
if (list_data->count == list_data->max) {
list_data->max += 8;
list_data->devinfo = realloc(list_data->devinfo,
sizeof(cubeb_device_info) * list_data->max);
sizeof(cubeb_device_info *) * list_data->max);
}
}

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

@ -1730,7 +1730,7 @@ wasapi_stream_init(cubeb * context, cubeb_stream ** stream,
void close_wasapi_stream(cubeb_stream * stm)
{
XASSERT(stm && !stm->thread && !stm->shutdown_event);
XASSERT(stm);
stm->stream_reset_lock->assert_current_thread_owns();