void AudioSinkWrapper::Start(int64_t aStartTime, const MediaInfo& aInfo) { AssertOwnerThread(); MOZ_ASSERT(!mIsStarted, "playback already started."); mIsStarted = true; mAudioSink = mCreator->Create(); mEndPromise = mAudioSink->Init(); SetPlaybackParams(mParams); }
void AudioSinkWrapper::Start(int64_t aStartTime, const MediaInfo& aInfo) { AssertOwnerThread(); MOZ_ASSERT(!mIsStarted, "playback already started."); mIsStarted = true; mPlayDuration = aStartTime; mPlayStartTime = TimeStamp::Now(); // no audio is equivalent to audio ended before video starts. mAudioEnded = !aInfo.HasAudio(); if (aInfo.HasAudio()) { mAudioSink = mCreator->Create(); mEndPromise = mAudioSink->Init(); SetPlaybackParams(mParams); mAudioSinkPromise.Begin(mEndPromise->Then( mOwnerThread.get(), __func__, this, &AudioSinkWrapper::OnAudioEnded, &AudioSinkWrapper::OnAudioEnded)); } }