From 9893d68d5eb4d01e64f5389788d6dcc97b76dacd Mon Sep 17 00:00:00 2001 From: Benjamin Chen Date: Mon, 31 Mar 2014 10:18:01 +0800 Subject: [PATCH] Bug 984816: RTSP play/pause deadlock issue. 1. Release the monitor when access mReader. 2. Reverse the order in RtspOmxReader::SetIdle(). r=cpearce --- content/media/MediaDecoderStateMachine.cpp | 5 ++++- content/media/omx/RtspOmxReader.cpp | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/content/media/MediaDecoderStateMachine.cpp b/content/media/MediaDecoderStateMachine.cpp index a72db1d4fd6..9f63c1d9eeb 100644 --- a/content/media/MediaDecoderStateMachine.cpp +++ b/content/media/MediaDecoderStateMachine.cpp @@ -1505,7 +1505,10 @@ MediaDecoderStateMachine::EnsureActive() return; } mIsReaderIdle = false; - SetReaderActive(); + { + ReentrantMonitorAutoExit exitMon(mDecoder->GetReentrantMonitor()); + SetReaderActive(); + } } void diff --git a/content/media/omx/RtspOmxReader.cpp b/content/media/omx/RtspOmxReader.cpp index aed8ddcaff0..f1a9b10b03c 100644 --- a/content/media/omx/RtspOmxReader.cpp +++ b/content/media/omx/RtspOmxReader.cpp @@ -312,6 +312,9 @@ RtspOmxReader::ReadMetadata(MediaInfo* aInfo, } void RtspOmxReader::SetIdle() { + // Call parent class to set OMXCodec idle. + MediaOmxReader::SetIdle(); + // Need to pause RTSP streaming OMXCodec decoding. if (mRtspResource) { nsIStreamingProtocolController* controller = @@ -320,9 +323,6 @@ void RtspOmxReader::SetIdle() { controller->Pause(); } } - - // Call parent class to set OMXCodec idle. - MediaOmxReader::SetIdle(); } void RtspOmxReader::SetActive() {