Closed Bug 1204757 Opened 5 years ago Closed 5 years ago

Remove MediaDataDemuxer::Init WAITING_FOR_DATA failure

Categories

(Core :: Audio/Video: Playback, defect)

43 Branch
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla43
Tracking Status
firefox43 --- fixed

People

(Reporter: jya, Assigned: jya)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

It is expected that the MediaFormatReader will call MediaDataDemuxer::Init() should the demuxer failed to resolve the init promise.

However, this is only a scenario that works using MediaSource.

Instead, the MediaDataDemuxer should not resolve the promise until it has all the metadata and reject it if having partial metadata is an error (this is the case for all demuxers but the mediasource one)
A MediaDataDemuxer is now not to resolve the init promise until it has all the metadata.
Except MediaSource, all demuxers would be doing blocking read to scan for the metadata, and having partial metadata would be an error.
For MediaSource, we pass the NotifyDataArrived message which will cause the MediaSourceDemuxer to re-attempt to search for the metadata.

When used within MediaSource's TrackBuffersManager, a demuxer will never be created until we have received a complete init segment (this task is performed by the various ContainerParsers)
Attachment #8661037 - Flags: review?(cpearce)
Comment on attachment 8661037 [details] [diff] [review]
P1. Update MediaDataDemuxer::Init() behavior.

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

::: dom/media/MediaDataDemuxer.h
@@ +45,5 @@
>  
>    // Initializes the demuxer. Other methods cannot be called unless
>    // initialization has completed and succeeded.
>    // Typically a demuxer will wait to parse the metadata before resolving the
> +  // promise. The promise must not be resolved should insufficient data be

Perhaps it's better to say the promise won't be resolved until sufficient data is supplied, i.e. your comment here could be read as the promise is *never* resolved if this is called when insufficient data is available.
Attachment #8661037 - Flags: review?(cpearce) → review+
Attachment #8661038 - Flags: review?(cpearce) → review+
You need to log in before you can comment on or make changes to this bug.