Bug 1423901 - Update cubeb from upstream to a88bf02. r=padenot

MozReview-Commit-ID: Kk8IwJZY0Mt

--HG--
extra : rebase_source : ad8a373b4ae8c29fc245efcfeeaab1e24fc76c0f
This commit is contained in:
Alex Chronopoulos 2017-12-07 16:42:20 +02:00
Родитель b336233de0
Коммит 1d4361649f
3 изменённых файлов: 26 добавлений и 6 удалений

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

@ -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 e17ba01b210b00fc15a33cad242286acb15a3492 (2017-11-28 16:18:38 +0200)
The git commit ID used was a88bf027a27038feedca386efe5801350832dd91 (2017-12-07 16:23:55 +0200)

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

@ -1752,8 +1752,12 @@ audiounit_create_aggregate_device(cubeb_stream * stm)
return CUBEB_ERROR;
}
if (input_nominal_rate != output_nominal_rate) {
Float64 rate = std::min(input_nominal_rate, output_nominal_rate);
/* Do not attempt to change the nominal rate if it's the same with the nominal rate of
* output device because it's the master device and rate will set to that anyway. */
uint32_t min_rate = std::min(input_nominal_rate, output_nominal_rate);
if (input_nominal_rate != output_nominal_rate && min_rate != output_nominal_rate) {
LOG("Update aggregate device rate to %u", min_rate);
Float64 rate = min_rate;
AudioObjectPropertyAddress addr = {kAudioDevicePropertyNominalSampleRate,
kAudioObjectPropertyScopeGlobal,
kAudioObjectPropertyElementMaster};
@ -1765,8 +1769,7 @@ audiounit_create_aggregate_device(cubeb_stream * stm)
sizeof(Float64),
&rate);
if (rv != noErr) {
LOG("AudioObjectSetPropertyData/kAudioDevicePropertyNominalSampleRate, rv=%d", rv);
return CUBEB_ERROR;
LOG("Non fatal error, AudioObjectSetPropertyData/kAudioDevicePropertyNominalSampleRate, rv=%d", rv);
}
}

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

@ -499,9 +499,21 @@ mask_to_channel_layout(WAVEFORMATEX const * fmt)
case MASK_3F1: return CUBEB_LAYOUT_3F1;
case MASK_3F1_LFE: return CUBEB_LAYOUT_3F1_LFE;
case MASK_2F2: return CUBEB_LAYOUT_2F2;
// Special case similar to MASK_2F2 but with rear left and right
// speakers instead of side left and right. This mapping is a band-aid as
// cubeb does not current have an enum to differentiate this and MASK_2F2,
// but is preferred to returning an undefined layout.
// See: https://github.com/kinetiknz/cubeb/issues/178 and https://bugzilla.mozilla.org/show_bug.cgi?id=1325023
case KSAUDIO_SPEAKER_QUAD: return CUBEB_LAYOUT_2F2;
case MASK_2F2_LFE: return CUBEB_LAYOUT_2F2_LFE;
case MASK_3F2: return CUBEB_LAYOUT_3F2;
case MASK_3F2_LFE: return CUBEB_LAYOUT_3F2_LFE;
// Special case similar to MASK_3F2_LFE but with rear left and right
// speakers instead of side left and right. his mapping is a band-aid as
// cubeb does not current have an enum to differentiate this and MASK_3F2_LFE,
// but is preferred to returning an undefined layout.
// See: https://github.com/kinetiknz/cubeb/issues/178 and https://bugzilla.mozilla.org/show_bug.cgi?id=1325023
case KSAUDIO_SPEAKER_5POINT1: return CUBEB_LAYOUT_3F2_LFE;
case MASK_3F3R_LFE: return CUBEB_LAYOUT_3F3R_LFE;
case MASK_3F4_LFE: return CUBEB_LAYOUT_3F4_LFE;
default: return CUBEB_LAYOUT_UNDEFINED;
@ -550,6 +562,7 @@ long
refill(cubeb_stream * stm, void * input_buffer, long input_frames_count,
void * output_buffer, long output_frames_needed)
{
XASSERT(!stm->draining);
/* If we need to upmix after resampling, resample into the mix buffer to
avoid a copy. */
void * dest = nullptr;
@ -756,6 +769,10 @@ refill_callback_duplex(cubeb_stream * stm)
return true;
}
/* Wait for draining is not important on duplex. */
if (stm->draining) {
return false;
}
ALOGV("Duplex callback: input frames: %Iu, output frames: %Iu",
input_frames, output_frames);
@ -1572,7 +1589,7 @@ int setup_wasapi_stream_one_side(cubeb_stream * stm,
mix_params->channels = mix_format->nChannels;
mix_params->layout = mask_to_channel_layout(mix_format.get());
if (mix_params->layout == CUBEB_LAYOUT_UNDEFINED) {
LOG("Output using undefined layout!\n");
LOG("Stream using undefined layout! Any mixing may be unpredictable!\n");
} else if (mix_format->nChannels != CUBEB_CHANNEL_LAYOUT_MAPS[mix_params->layout].channels) {
// The CUBEB_CHANNEL_LAYOUT_MAPS[mix_params->layout].channels may be
// different from the mix_params->channels. 6 channel ouput with stereo