diff --git a/mythtv/libs/libmyth/audio/audiooutputca.cpp b/mythtv/libs/libmyth/audio/audiooutputca.cpp index 23b82c629d9..9bf6d63faa1 100644 --- a/mythtv/libs/libmyth/audio/audiooutputca.cpp +++ b/mythtv/libs/libmyth/audio/audiooutputca.cpp @@ -200,17 +200,28 @@ AudioOutputSettings* AudioOutputCA::GetOutputSettings(bool digital) // Seek hardware sample rate available int rate; int *rates = d->RatesList(d->mDeviceID); - int *p_rates = rates; - while (*p_rates > 0 && (rate = settings->GetNextRate())) + if (rates == NULL) { - if (*p_rates == rate) + // Error retrieving rates, assume 48kHz + settings->AddSupportedRate(48000); + } + else + { + while ((rate = settings->GetNextRate())) { - settings->AddSupportedRate(*p_rates); - p_rates++; + int *p_rates = rates; + while (*p_rates > 0) + { + if (*p_rates == rate) + { + settings->AddSupportedRate(*p_rates); + } + p_rates++; + } } + free(rates); } - free(rates); // Supported format: 16 bits audio or float settings->AddSupportedFormat(FORMAT_S16);