mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1676551 - part1 : handle rejected promise when fail to start the audio sink. r=padenot
In the change from bug1674597, AudioSinkWrapper only handles the promise when we succeed opening AudioSink. However, it forgots to handle the promise when fail to start AudioSink. Differential Revision: https://phabricator.services.mozilla.com/D96738
This commit is contained in:
parent
f50c3a4253
commit
f798106d65
@ -170,15 +170,15 @@ nsresult AudioSinkWrapper::Start(const TimeUnit& aStartTime,
|
||||
if (rv.isErr()) {
|
||||
mEndedPromise =
|
||||
MediaSink::EndedPromise::CreateAndReject(rv.unwrapErr(), __func__);
|
||||
return rv.unwrapErr();
|
||||
} else {
|
||||
mEndedPromise = rv.unwrap();
|
||||
}
|
||||
|
||||
mEndedPromise = rv.unwrap();
|
||||
mEndedPromise
|
||||
->Then(mOwnerThread.get(), __func__, this,
|
||||
&AudioSinkWrapper::OnAudioEnded, &AudioSinkWrapper::OnAudioEnded)
|
||||
->Track(mAudioSinkEndedPromise);
|
||||
return NS_OK;
|
||||
return rv.isErr() ? rv.unwrapErr() : NS_OK;
|
||||
}
|
||||
|
||||
bool AudioSinkWrapper::IsAudioSourceEnded(const MediaInfo& aInfo) const {
|
||||
|
Loading…
Reference in New Issue
Block a user