Bug 1029251 - MP4Reader::Flush should grab lock in the right order. r=kinetik
authorMichael Shuen <mz_mhs-ctb@outlook.com>
Thu, 26 Jun 2014 08:31:00 +0200
changeset 213064 408918a4891fffe7aaadb98be9688ebffcec25f6
parent 213063 17e249385be6fb156b0741f251be6a9651874b25
child 213065 f0359665c82079b713b4b582760ee59ffae11285
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskinetik
bugs1029251
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1029251 - MP4Reader::Flush should grab lock in the right order. r=kinetik
content/media/fmp4/MP4Reader.cpp
--- a/content/media/fmp4/MP4Reader.cpp
+++ b/content/media/fmp4/MP4Reader.cpp
@@ -452,23 +452,23 @@ MP4Reader::Flush(TrackType aTrack)
   DecoderData& data = GetDecoderData(aTrack);
   if (!data.mDecoder) {
     return;
   }
   // Purge the current decoder's state.
   // Set a flag so that we ignore all output while we call
   // MediaDataDecoder::Flush().
   {
+    MonitorAutoLock mon(data.mMonitor);
     data.mIsFlushing = true;
-    MonitorAutoLock mon(data.mMonitor);
   }
   data.mDecoder->Flush();
   {
+    MonitorAutoLock mon(data.mMonitor);
     data.mIsFlushing = false;
-    MonitorAutoLock mon(data.mMonitor);
   }
 }
 
 bool
 MP4Reader::SkipVideoDemuxToNextKeyFrame(int64_t aTimeThreshold, uint32_t& parsed)
 {
   MOZ_ASSERT(mVideo.mDecoder);