Bug 1434477 - If AudioCallbackDriver::Init() can't get a cubeb context, fall back to system clock driver. r=padenot

Change AudioCallbackDriver::Init() to fallback to a system clock driver if a
cubeb context can not be obtained. This should make driver init more robust in
cases where cubeb init fails and then CubebUtils::GetCubebContext() returns no
context.

MozReview-Commit-ID: IlFPytYacoI

--HG--
extra : rebase_source : 7445ceb49583ee3ae399252e995ce6f012d9da2f
This commit is contained in:
Bryce Van Dyk 2018-03-19 14:46:36 -04:00
Родитель 70d6e49a13
Коммит 978c69f8d4
1 изменённых файлов: 4 добавлений и 1 удалений

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

@ -593,10 +593,13 @@ AudioCallbackDriver::Init()
cubeb* cubebContext = CubebUtils::GetCubebContext();
if (!cubebContext) {
NS_WARNING("Could not get cubeb context.");
LOG(LogLevel::Warning, ("%s: Could not get cubeb context", __func__));
if (!mFromFallback) {
CubebUtils::ReportCubebStreamInitFailure(true);
}
return false;
MonitorAutoLock lock(GraphImpl()->GetMonitor());
FallbackToSystemClockDriver();
return true;
}
cubeb_stream_params output;