Closed Bug 1055907 Opened 10 years ago Closed 10 years ago

MP4Reader can stick output into MediaQueues after flush but before next Decode() call

Categories

(Core :: Audio/Video, defect)

29 Branch
x86_64
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla34

People

(Reporter: cpearce, Assigned: cpearce)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Two small problems in MP4Reader:

1. If output is sitting in a runnable on a task queue waiting to be delivered to the MP4Reader's Output function, it can end be being stuck into the MediaQueue in MP4Reader::Output. This can disrupt seeking or shutdown.

2. In MP4Reader::ReadMetadata() the path that creates the CDMWrapper PDM relies on HasAudio() working, but HasAudio() won't work until after the "if (mDemuxer->HasValidAudio()) {" block further down, as that initializes mInfo.mAudio.mHasAudio and mAudio.mActive. We should initialize these earlier, otherwise the HasAudio() return value we pass to PlatformDecoderModule::CreateCDMWrapper() will be wrong, and we won't create a PDM when we need one.
(In reply to Chris Pearce (:cpearce) from comment #0)
> Two small problems in MP4Reader:
> 
> 1. If output is sitting in a runnable on a task queue waiting to be
> delivered to the MP4Reader's Output function, it can end be being stuck into
> the MediaQueue in MP4Reader::Output. This can disrupt seeking or shutdown.

This doesn't disrupt seeking, at least not for the WMF PDM, there seems to be a bug in the demuxer that was causing my problems. We can still call MP4Reader::Output while flushing, and we need to delete the MediaData object passed to us if so, otherwise we'll leak.
Ensure we don't leak if output arrives while we're flushing.
Attachment #8475675 - Flags: review?(ajones)
Make MP4Reader::HasAudio() work earlier in ReadMetadata(), as we need it to tell whether we should create a PDM and audio decoder which we wrap with a EME Decryptor.
Attachment #8475676 - Flags: review?(ajones)
Attachment #8475675 - Flags: review?(ajones) → review+
Attachment #8475676 - Flags: review?(ajones) → review+
https://hg.mozilla.org/mozilla-central/rev/8c5f7a39a59a
https://hg.mozilla.org/mozilla-central/rev/a4200559a648
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: