Bug 1285248. Part 1 - the value of aSeekJob.mTarget.IsVideoOnly() is wrong because the members are reset in the move constructor. draft
authorJW Wang <jwwang@mozilla.com>
Fri, 08 Jul 2016 08:34:14 +0800
changeset 385365 f17e5e969bcbca286d24f96da60c2db2dd161766
parent 385002 4764b9f8e6d4ef9823237f01ca3901759ce8daeb
child 385366 ae1372e6155509c4c362c529e638938be2d66fa8
child 385372 7b9d361a700e020130254e523e272bf8c012527c
push id22485
push userjwwang@mozilla.com
push dateFri, 08 Jul 2016 08:02:19 +0000
bugs1285248
milestone50.0a1
Bug 1285248. Part 1 - the value of aSeekJob.mTarget.IsVideoOnly() is wrong because the members are reset in the move constructor. mDoneAudioSeeking should be true for video-only seek. Otherwise we might request audio while a pending request is already in progress and hit the assertion. MozReview-Commit-ID: IeVjoEChLAR
dom/media/AccurateSeekTask.cpp
--- a/dom/media/AccurateSeekTask.cpp
+++ b/dom/media/AccurateSeekTask.cpp
@@ -40,17 +40,17 @@ AccurateSeekTask::AccurateSeekTask(const
                                    MediaDecoderReaderWrapper* aReader,
                                    SeekJob&& aSeekJob,
                                    const MediaInfo& aInfo,
                                    const media::TimeUnit& aEnd,
                                    int64_t aCurrentMediaTime)
   : SeekTask(aDecoderID, aThread, aReader, Move(aSeekJob))
   , mCurrentTimeBeforeSeek(media::TimeUnit::FromMicroseconds(aCurrentMediaTime))
   , mAudioRate(aInfo.mAudio.mRate)
-  , mDoneAudioSeeking(!aInfo.HasAudio() || aSeekJob.mTarget.IsVideoOnly())
+  , mDoneAudioSeeking(!aInfo.HasAudio() || mSeekJob.mTarget.IsVideoOnly())
   , mDoneVideoSeeking(!aInfo.HasVideo())
 {
   AssertOwnerThread();
 
   // Bound the seek time to be inside the media range.
   NS_ASSERTION(aEnd.ToMicroseconds() != -1, "Should know end time by now");
   mSeekJob.mTarget.SetTime(
     std::max(media::TimeUnit(), std::min(mSeekJob.mTarget.GetTime(), aEnd)));