mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 06:15:43 +00:00
Bug 1212246. Part 2 - remove mTaskQueueIsBorrowed and unnecessary checks for mTaskQueue is never null. r=jya.
This commit is contained in:
parent
32c513290f
commit
146f761ff8
@ -76,7 +76,6 @@ MediaDecoderReader::MediaDecoderReader(AbstractMediaDecoder* aDecoder)
|
||||
, mIgnoreAudioOutputFormat(false)
|
||||
, mHitAudioDecodeError(false)
|
||||
, mShutdown(false)
|
||||
, mTaskQueueIsBorrowed(!!aBorrowedTaskQueue)
|
||||
, mAudioDiscontinuity(false)
|
||||
, mVideoDiscontinuity(false)
|
||||
{
|
||||
@ -372,7 +371,7 @@ MediaDecoderReader::RequestAudioData()
|
||||
// waiting in this while loop since it somehow prevents audio EOS from
|
||||
// coming in gstreamer 1.x when there is still video buffer waiting to be
|
||||
// consumed. (|mVideoSinkBufferCount| > 0)
|
||||
if (AudioQueue().GetSize() == 0 && mTaskQueue) {
|
||||
if (AudioQueue().GetSize() == 0) {
|
||||
RefPtr<nsIRunnable> task(new ReRequestAudioTask(this));
|
||||
mTaskQueue->Dispatch(task.forget());
|
||||
return p;
|
||||
@ -423,22 +422,10 @@ MediaDecoderReader::Shutdown()
|
||||
|
||||
nsRefPtr<ShutdownPromise> p;
|
||||
|
||||
// Spin down the task queue if necessary. We wait until BreakCycles to null
|
||||
// out mTaskQueue, since otherwise any remaining tasks could crash when they
|
||||
// invoke OnTaskQueue().
|
||||
if (mTaskQueue && !mTaskQueueIsBorrowed) {
|
||||
// If we own our task queue, shutdown ends when the task queue is done.
|
||||
p = mTaskQueue->BeginShutdown();
|
||||
} else {
|
||||
// If we don't own our task queue, we resolve immediately (though
|
||||
// asynchronously).
|
||||
p = ShutdownPromise::CreateAndResolve(true, __func__);
|
||||
}
|
||||
|
||||
mTimer = nullptr;
|
||||
mDecoder = nullptr;
|
||||
|
||||
return p;
|
||||
return mTaskQueue->BeginShutdown();
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
@ -428,8 +428,6 @@ private:
|
||||
MozPromiseHolder<AudioDataPromise> mBaseAudioPromise;
|
||||
MozPromiseHolder<VideoDataPromise> mBaseVideoPromise;
|
||||
|
||||
bool mTaskQueueIsBorrowed;
|
||||
|
||||
// Flags whether a the next audio/video sample comes after a "gap" or
|
||||
// "discontinuity" in the stream. For example after a seek.
|
||||
bool mAudioDiscontinuity;
|
||||
|
Loading…
Reference in New Issue
Block a user