Closed Bug 1128420 Opened 5 years ago Closed 5 years ago

Properly handle finished output streams in MediaDecoder

Categories

(Core :: Audio/Video, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38
Tracking Status
firefox38 --- fixed

People

(Reporter: jwwang, Assigned: jwwang)

References

Details

Attachments

(1 file)

When we seek at a position near the end to a previous position, chances are the output stream is finished without MediaDecoder::PlaybackEnded being called. The finished stream is then re-connected to the decoded stream in MediaDecoder::RecreateDecodedStream() and block the decoded stream. Therefore, the captured media element wouldn't be able to play after seeking.

We need to ensure finished streams are removed from the output streams of MediaDecoder to avoid this problem.
Blocks: 1128417
Remove finished streams in a reliable way. See comment 0 for the detail.

Try: https://tbpl.mozilla.org/?tree=Try&rev=4d9432fb964e
Most green in 30 runs on most platforms.
Assignee: nobody → jwwang
Status: NEW → ASSIGNED
Attachment #8561185 - Flags: review?(roc)
Comment on attachment 8561185 [details] [diff] [review]
1128420_remove_finished_output_streams-v1.patch

Review of attachment 8561185 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/media/MediaDecoder.cpp
@@ -944,5 @@
>        mPlayState == PLAY_STATE_LOADING) {
>      return;
>    }
>  
> -  {

OutputStreamListener is responsible for removing finished streams. We don't need this block in PlaybackEnded() anymore.

::: dom/media/MediaDecoder.h
@@ -496,4 @@
>      nsRefPtr<ProcessedMediaStream> mStream;
>      // mPort connects mDecodedStream->mStream to our mStream.
>      nsRefPtr<MediaInputPort> mPort;
> -    bool mFinishWhenEnded;

We don't need mFinishWhenEnded for OutputStreamListener will be responsible for removing finished streams.
https://hg.mozilla.org/mozilla-central/rev/0f4fc6a418ed
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Blocks: 1127235
Blocks: 1203449
You need to log in before you can comment on or make changes to this bug.