Closed
Bug 1272182
Opened 9 years ago
Closed 9 years ago
loadedmetadata shouldn't be fired if we have no way of decoding the data
Categories
(Core :: Audio/Video: Playback, defect)
Core
Audio/Video: Playback
Tracking
()
RESOLVED
FIXED
mozilla49
| Tracking | Status | |
|---|---|---|
| firefox49 | --- | fixed |
People
(Reporter: jya, Assigned: jya)
References
Details
Attachments
(2 files)
Bug 1207198 changed the behaviour to accept media's metadata so long as we have a duration and dimensions.
This was changed as the loadedmetadata definition in the spec is:
"The user agent has just determined the duration and dimensions of the media resource and the text tracks are ready. "
however, in the list of actions to be performed prior changing the readyState and firing the loadedmetadata event, we can read:
https://w3c.github.io/html/semantics-embedded-content.html#media-data-processing-steps-list
"If the media data can be fetched but is found by inspection to be in an unsupported format, or can otherwise not be rendered at all "
So, we should check if we can actually decode the video tracks prior accepting the metadata.
| Assignee | ||
Comment 1•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/52091/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/52091/
Attachment #8751557 -
Flags: review?(cpearce)
Attachment #8751558 -
Flags: review?(cpearce)
| Assignee | ||
Comment 2•9 years ago
|
||
Similar logic with audio tracks, but those are ignored instead.
Review commit: https://reviewboard.mozilla.org/r/52093/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/52093/
Comment 3•9 years ago
|
||
Comment on attachment 8751557 [details]
MozReview Request: Bug 1272182: P1. Ignore invalid video tracks. r?cpearce
https://reviewboard.mozilla.org/r/52091/#review49015
::: dom/media/MediaFormatReader.cpp:301
(Diff revision 1)
> - }
> + }
> - mVideo.mCallback = new DecoderCallback(this, TrackInfo::kVideoTrack);
> + mVideo.mCallback = new DecoderCallback(this, TrackInfo::kVideoTrack);
> - mVideo.mTimeRanges = mVideo.mTrackDemuxer->GetBuffered();
> + mVideo.mTimeRanges = mVideo.mTrackDemuxer->GetBuffered();
> - mTrackDemuxersMayBlock |= mVideo.mTrackDemuxer->GetSamplesMayBlock();
> + mTrackDemuxersMayBlock |= mVideo.mTrackDemuxer->GetSamplesMayBlock();
> + } else {
> + mVideo.mTrackDemuxer->BreakCycles();
Other places that call m{Audio,Video}.mTrackDemuxer->BreakCycles() also call m{Audio,Video}.mTrackDemuxer m{Audio,Video}.ResetDemuxer(). Should you also be doing that here?
Attachment #8751557 -
Flags: review?(cpearce) → review+
Comment 4•9 years ago
|
||
Comment on attachment 8751558 [details]
MozReview Request: Bug 1272182: P2. Reject upfront videos for which we have no decoder. r?cpearce
https://reviewboard.mozilla.org/r/52093/#review49017
::: dom/media/MediaFormatReader.cpp:306
(Diff revision 1)
> + mMetadataPromise.Reject(ReadMetadataFailureReason::METADATA_ERROR, __func__);
> + return;
> + }
> +
> if (videoActive) {
> mInfo.mVideo = *videoInfo->GetAsVideoInfo();
You could nest the "platform && !platform->SupportsMimeType" check inside this videoActive check, to save checking it twice.
::: dom/media/MediaFormatReader.cpp:329
(Diff revision 1)
> return;
> }
> +
> UniquePtr<TrackInfo> audioInfo = mAudio.mTrackDemuxer->GetInfo();
> // We actively ignore audio tracks that we know we can't play.
> audioActive = audioInfo && audioInfo->IsValid();
You could calculate the value of audioActive in one statement instead of two.
Attachment #8751558 -
Flags: review?(cpearce) → review+
| Assignee | ||
Comment 5•9 years ago
|
||
https://reviewboard.mozilla.org/r/52091/#review49015
> Other places that call m{Audio,Video}.mTrackDemuxer->BreakCycles() also call m{Audio,Video}.mTrackDemuxer m{Audio,Video}.ResetDemuxer(). Should you also be doing that here?
it will be done when the MFR will shutdown.
The only reason I had to shut down the track demuxer, is that HasAudio() and HasVideo() are actually return !!mAudio/mVideo.mTrackDemuxer
| Assignee | ||
Comment 6•9 years ago
|
||
https://reviewboard.mozilla.org/r/52091/#review49015
> it will be done when the MFR will shutdown.
>
> The only reason I had to shut down the track demuxer, is that HasAudio() and HasVideo() are actually return !!mAudio/mVideo.mTrackDemuxer
oh, and also, the trackdemuxer haven't been used yet. so no need to reset them
| Assignee | ||
Comment 7•9 years ago
|
||
https://reviewboard.mozilla.org/r/52093/#review49017
> You could calculate the value of audioActive in one statement instead of two.
yeah, but then it makes it all go unto multiple line with extra parantheses; I figured it was clearer to read that way
Comment 9•9 years ago
|
||
Backed out as requested by jya for missing the latest updates:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9d9a2d8eddfe
https://hg.mozilla.org/integration/mozilla-inbound/rev/dd2ceebf75b7
| Assignee | ||
Comment 10•9 years ago
|
||
Comment on attachment 8751558 [details]
MozReview Request: Bug 1272182: P2. Reject upfront videos for which we have no decoder. r?cpearce
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/52093/diff/1-2/
Comment 11•9 years ago
|
||
Comment 12•9 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/9673bccca574
https://hg.mozilla.org/mozilla-central/rev/45c56040ec81
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in
before you can comment on or make changes to this bug.
Description
•