Bug 1114802 - MP4: Hold demuxer monitor while resetting. r=kentuckyfriedtakahe, a=sledru
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 23 Dec 2014 13:39:35 +1100
changeset 234636 b0b4d61a7581512fe995984804538af79104b474
parent 234635 1a647f19f02d712ae69e6f4c9ed395d0ddb4bc29
child 234637 0ffff4dc528d004d6e249cb83aa66f9edef566ea
push id7447
push userryanvm@gmail.com
push dateWed, 07 Jan 2015 21:16:24 +0000
treeherdermozilla-aurora@1aaa04637144 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskentuckyfriedtakahe, sledru
bugs1114802
milestone36.0a2
Bug 1114802 - MP4: Hold demuxer monitor while resetting. r=kentuckyfriedtakahe, a=sledru
dom/media/fmp4/MP4Reader.cpp
--- a/dom/media/fmp4/MP4Reader.cpp
+++ b/dom/media/fmp4/MP4Reader.cpp
@@ -667,19 +667,25 @@ MP4Reader::SizeOfQueue(TrackType aTrack)
   return decoder.mOutput.Length() + (decoder.mNumSamplesInput - decoder.mNumSamplesOutput);
 }
 
 nsresult
 MP4Reader::ResetDecode()
 {
   MOZ_ASSERT(GetTaskQueue()->IsCurrentThreadIn());
   Flush(kVideo);
-  mDemuxer->SeekVideo(0);
+  {
+    MonitorAutoLock mon(mIndexMonitor);
+    mDemuxer->SeekVideo(0);
+  }
   Flush(kAudio);
-  mDemuxer->SeekAudio(0);
+  {
+    MonitorAutoLock mon(mIndexMonitor);
+    mDemuxer->SeekAudio(0);
+  }
   return MediaDecoderReader::ResetDecode();
 }
 
 void
 MP4Reader::Output(TrackType aTrack, MediaData* aSample)
 {
 #ifdef LOG_SAMPLE_DECODE
   VLOG("Decoded %s sample time=%lld dur=%lld",