Closed Bug 1302632 Opened 8 years ago Closed 8 years ago

Incorrect error fired when media segment is added prior an init segment

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla51
Tracking Status
firefox51 --- fixed

People

(Reporter: jya, Assigned: jya)

References

(Blocks 1 open bug, )

Details

Attachments

(5 files)

The issue isn't specifically related to MSE, but would be mostly seen there. When endOfStream() algorithm is called with error set to "decode" we read: https://w3c.github.io/media-source/index.html#end-of-stream-algorithm " If error is set to "decode" If the HTMLMediaElement.readyState attribute equals HAVE_NOTHING Run the "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" steps of the resource fetch algorithm's media data processing steps list. If the HTMLMediaElement.readyState attribute is greater than HAVE_NOTHING Run the media data is corrupted steps of the resource fetch algorithm's media data processing steps list. " If a media segment is added before an init segment, we are to call the endOfStream algorithm with the error set to "decode" As no init segment has been added yet, we are in HTMLMediaElement.readyState == HAVE_NOTHING case part of the resource fetch algorithm, "Failed with media provider: Reaching this step indicates that the media resource failed to load. Queue a task to run the dedicated media source failure steps." The dedicated media source failure steps being: https://www.w3.org/TR/html51/semantics-embedded-content.html#dedicated-media-source-failure-steps "Set the error attribute to a new MediaError object whose code attribute is set to MEDIA_ERR_SRC_NOT_SUPPORTED. " error.code should be set to MEDIA_ERR_SRC_NOT_SUPPORTED, currently it is set to MEDIA_ERR_DECODE
Blocks: 1302304
Comment on attachment 8791068 [details] Bug 1302632: P1. Set proper error code when readyState is HAVE_NOTHING. https://reviewboard.mozilla.org/r/78628/#review77256 ::: dom/html/HTMLMediaElement.cpp:4433 (Diff revision 1) > ReportLoadError("MediaLoadDecodeError", params, ArrayLength(params)); > > if (mDecoder) { > ShutdownDecoder(); > } > + bool isMediaSource = !!mMediaSource; Why not checking if (mMediaSource ...) as above so we don't need this temp variable? ::: dom/html/HTMLMediaElement.cpp:4447 (Diff revision 1) > DispatchAsyncSourceError(mSourceLoadCandidate); > QueueLoadFromSourceTask(); > } else { > NS_WARNING("Should know the source we were loading from!"); > } > } else { Do: else if (...) { } else { } so we have only 1 level of if/else
Attachment #8791068 - Flags: review?(jwwang) → review+
Comment on attachment 8791069 [details] Bug 1302632: P2. Only have Description return a non-empty string in case of error. https://reviewboard.mozilla.org/r/78630/#review77258
Attachment #8791069 - Flags: review?(jwwang) → review+
Comment on attachment 8791070 [details] Bug 1302632: P3. Provide failures details to error attribute. https://reviewboard.mozilla.org/r/78632/#review77260 ::: dom/html/HTMLMediaElement.cpp:1043 (Diff revision 1) > > mEventDeliveryPaused = false; > mPendingEvents.Clear(); > } > > -void HTMLMediaElement::NoSupportedMediaSourceError() > +void HTMLMediaElement::NoSupportedMediaSourceError(const MediaResult& aErrorDetails) You pass a MediaResult but only use its Description(). Might be better to just pass an nsCString.
Attachment #8791070 - Flags: review?(jwwang) → review+
Upon further thought (and more reading). I think this is not MSE specific anyway. If we're unable to fetch the content or if the content type can't be determined (e.g. unable to read the metadata), then we should set MediaError.code to MEDIA_ERR_SRC_NOT_SUPPORTED. That's my reading of the spec. There's no distinction in the spec between: "If the media data cannot be fetched at all, due to network errors, causing the user agent to give up trying to fetch the resource" steps and the "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" in the resource fetch algorithm https://www.w3.org/TR/html51/semantics-embedded-content.html#resource-fetch-algorithm
Comment on attachment 8791068 [details] Bug 1302632: P1. Set proper error code when readyState is HAVE_NOTHING. https://reviewboard.mozilla.org/r/78628/#review77256 > Why not checking if (mMediaSource ...) as above so we don't need this temp variable? because mMediaSource is set to null in between. Having said that, setting mMediaSource to null is wrong and will be addressed in bug 1302656
Comment on attachment 8791070 [details] Bug 1302632: P3. Provide failures details to error attribute. https://reviewboard.mozilla.org/r/78632/#review77260 > You pass a MediaResult but only use its Description(). Might be better to just pass an nsCString. ok
Comment on attachment 8791485 [details] Bug 1302632: P4. Do not change network state to NETWORK_EMPTY. https://reviewboard.mozilla.org/r/78924/#review77526
Attachment #8791485 - Flags: review?(jwwang) → review+
JW, could you have a look on P1? I've removed the check that it was only applicable to MSE.
Flags: needinfo?(jwwang)
(In reply to Jean-Yves Avenard [:jya] from comment #7) > Upon further thought (and more reading). > > I think this is not MSE specific anyway. > > If we're unable to fetch the content or if the content type can't be > determined (e.g. unable to read the metadata), then we should set > MediaError.code to MEDIA_ERR_SRC_NOT_SUPPORTED. > > That's my reading of the spec. > There's no distinction in the spec between: > "If the media data cannot be fetched at all, due to network errors, causing > the user agent to give up trying to fetch the resource" steps and the "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" in the resource > fetch algorithm > https://www.w3.org/TR/html51/semantics-embedded-content.html#resource-fetch- > algorithm https://html.spec.whatwg.org/multipage/embedded-content.html#dom-mediaerror-media_err_src_not_supported I think so. The precondition of MEDIA_ERR_NETWORK and MEDIA_ERR_DECODE is "after the resource was established to be usable.". So P1 LGTM.
Flags: needinfo?(jwwang)
Assignee: nobody → jyavenard
Pushed by jyavenard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7d7558864a66 P1. Set proper error code when readyState is HAVE_NOTHING. r=jwwang https://hg.mozilla.org/integration/autoland/rev/22772e4a9c72 P2. Only have Description return a non-empty string in case of error. r=jwwang https://hg.mozilla.org/integration/autoland/rev/b20f7c887e6c P3. Provide failures details to error attribute. r=jwwang https://hg.mozilla.org/integration/autoland/rev/55e7962d4fc0 P4. Do not change network state to NETWORK_EMPTY. r=jwwang https://hg.mozilla.org/integration/autoland/rev/f2ced742d6aa P5. Update mochitests. r=gerald
Backed out in https://hg.mozilla.org/integration/autoland/rev/3172114c06cdf084d9e46c394c47e62c672c7259 because Try says it's not going to go that well after all.
Pushed by jyavenard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fc8cd368bace P1. Set proper error code when readyState is HAVE_NOTHING. r=jwwang https://hg.mozilla.org/integration/autoland/rev/e628ce8270d7 P2. Only have Description return a non-empty string in case of error. r=jwwang https://hg.mozilla.org/integration/autoland/rev/0cb8732f7d66 P3. Provide failures details to error attribute. r=jwwang https://hg.mozilla.org/integration/autoland/rev/7442beabc153 P4. Do not change network state to NETWORK_EMPTY. r=jwwang https://hg.mozilla.org/integration/autoland/rev/3c4a5256eff7 P5. Update mochitests. r=gerald
Depends on: 1303970
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: