Closed
Bug 984816
Opened 10 years ago
Closed 10 years ago
[RTSP] Play/pause does not work for RTSP streaming
Categories
(Firefox OS Graveyard :: RTSP, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
2.0 S1 (9may)
People
(Reporter: ethan, Assigned: bechen)
Details
Attachments
(1 file, 1 obsolete file)
1.99 KB,
patch
|
bechen
:
review+
|
Details | Diff | Splinter Review |
Reproduction Steps: 1. Enable the preference "media.rtsp.video.enabled" (disabled by default). 2. Click an RTSP URL. 3. When the video app is playing the RTSP streaming, press pause button. 4. Press play button. Bug: RTSP streaming is not played after step 4. Note: 1. Although not 100% sure, we guess this bug happens after bug 973408 was landed. 2. I verified RtspController::Play() was not called in step 4.
Reporter | ||
Updated•10 years ago
|
Assignee: nobody → vchang
Updated•10 years ago
|
Component: Video/Audio → RTSP
Product: Core → Firefox OS
Version: Trunk → unspecified
Comment 1•10 years ago
|
||
The root cause here is similar to the seek issue we found in Bug 947113. The tasks dispatch to mDecodeTaskQueue is pended because function DecodeVideoFrame() is blocked function. http://dxr.mozilla.org/mozilla-central/source/content/media/MediaDecoderStateMachine.cpp#603 http://dxr.mozilla.org/mozilla-central/source/content/media/RtspMediaResource.cpp#214 This issue is easy to reproduce especially when network is slow. Still trying to find the better solution for this.
Assignee | ||
Comment 3•10 years ago
|
||
There are 2 deadlock issues when press pause/play on RTSP streaming. 1. When the streaming is paused, then press play button. Thread 1 : |MediaDecoderStateMachine::DecodeVideo()| hold a lock then call |EnsureActive();| dispatch a play command to main thread. This thread will be blocked in RtpsMediaResource because there is no more data in it. Main thread : be blocked |MediaDecoder::PlaybackPositionChanged()| because the lock is held by thread 1, then the play command can not be executed. solution: release the lock in |EnsureActive| 2. When press pause button. Thread 1: binder thread hold a lock in OMXCodec then be blocked in RtspMediaResource. Thread 2: Trying to execute the pause command but it can't get the lock. solution : reverse the order in RtspOmxReader::SetIdle()
Assignee | ||
Comment 4•10 years ago
|
||
Comment on attachment 8397541 [details] [diff] [review] bug-984816.patch Hi Chris: Please help review this patch. Is it safe to release the monitor in EnsureActive? Hi Vincent and Ethan: Please help to try this patch to see if there is still deadlock issues.
Attachment #8397541 -
Flags: review?(cpearce)
Reporter | ||
Comment 5•10 years ago
|
||
(In reply to Benjamin Chen [:bechen] from comment #4) > Hi Vincent and Ethan: > Please help to try this patch to see if there is still deadlock issues. I manually tested both RTSP and HTTP streaming with your patch. I performed play/pause for dozens of times and didn't encounter any blocking (deadlock). So far so good. :)
Comment 6•10 years ago
|
||
Comment on attachment 8397541 [details] [diff] [review] bug-984816.patch Review of attachment 8397541 [details] [diff] [review]: ----------------------------------------------------------------- Good catch! ::: content/media/MediaDecoderStateMachine.cpp @@ +1498,5 @@ > return; > } > mIsReaderIdle = false; > + { > + ReentrantMonitorAutoExit exitMon(mDecoder->GetReentrantMonitor()); Please also release the monitor while mReader->SetIdle() is called in SetReaderIdle(), the same bug could happen there too.
Attachment #8397541 -
Flags: review?(cpearce) → review+
Assignee | ||
Comment 7•10 years ago
|
||
(In reply to Chris Pearce (:cpearce) from comment #6) > Comment on attachment 8397541 [details] [diff] [review] > bug-984816.patch > > Review of attachment 8397541 [details] [diff] [review]: > ----------------------------------------------------------------- > > Good catch! > > ::: content/media/MediaDecoderStateMachine.cpp > @@ +1498,5 @@ > > return; > > } > > mIsReaderIdle = false; > > + { > > + ReentrantMonitorAutoExit exitMon(mDecoder->GetReentrantMonitor()); > > Please also release the monitor while mReader->SetIdle() is called in > SetReaderIdle(), the same bug could happen there too. I don't think it is necessary to release the monitor in SetReaderIdle() because the caller of SetReaderIdle() would not hold the monitor. (Now we don't have an EnsureIdle function like EnsureActive)
Comment 8•10 years ago
|
||
Ah yes, very good.
Assignee | ||
Comment 9•10 years ago
|
||
try server: https://tbpl.mozilla.org/?tree=Try&rev=79391c484f6c r=cpearce
Attachment #8399190 -
Flags: review+
Assignee | ||
Updated•10 years ago
|
Attachment #8397541 -
Attachment is obsolete: true
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 11•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/d0080077a537
Status: NEW → RESOLVED
Closed: 10 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 1.5 S1 (9may)
You need to log in
before you can comment on or make changes to this bug.
Description
•