mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 928547: Change AudioStream cubeb-dependent logic to handle success cases first, so we can add #ifdef that ends in failure case. r=padenot
This commit is contained in:
parent
388b302e9e
commit
a4e08580e0
@ -433,15 +433,16 @@ AudioStream* AudioStream::AllocateStream()
|
||||
|
||||
int AudioStream::MaxNumberOfChannels()
|
||||
{
|
||||
uint32_t maxNumberOfChannels, rv;
|
||||
#if defined(MOZ_CUBEB)
|
||||
uint32_t maxNumberOfChannels;
|
||||
|
||||
rv = cubeb_get_max_channel_count(GetCubebContext(), &maxNumberOfChannels);
|
||||
|
||||
if (rv != CUBEB_OK) {
|
||||
return 0;
|
||||
if (cubeb_get_max_channel_count(GetCubebContext(),
|
||||
&maxNumberOfChannels) == CUBEB_OK) {
|
||||
return static_cast<int>(maxNumberOfChannels);
|
||||
}
|
||||
#endif
|
||||
|
||||
return static_cast<int>(maxNumberOfChannels);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int AudioStream::PreferredSampleRate()
|
||||
@ -453,9 +454,13 @@ int AudioStream::PreferredSampleRate()
|
||||
// backend used.
|
||||
const int fallbackSampleRate = 44100;
|
||||
if (mPreferredSampleRate == 0) {
|
||||
if (cubeb_get_preferred_sample_rate(GetCubebContext(), &mPreferredSampleRate) != CUBEB_OK) {
|
||||
mPreferredSampleRate = fallbackSampleRate;
|
||||
#if defined(MOZ_CUBEB)
|
||||
if (cubeb_get_preferred_sample_rate(GetCubebContext(),
|
||||
&mPreferredSampleRate) == CUBEB_OK) {
|
||||
return mPreferredSampleRate;
|
||||
}
|
||||
#endif
|
||||
mPreferredSampleRate = fallbackSampleRate;
|
||||
}
|
||||
|
||||
return mPreferredSampleRate;
|
||||
|
Loading…
Reference in New Issue
Block a user