Changeset 232061 in webkit


Ignore:
Timestamp:
May 22, 2018 4:40:13 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

[GStreamer] Don't set the ReadyState to HaveNothing when an error occurs in playback pipeline
https://bugs.webkit.org/show_bug.cgi?id=185725

Patch by Yacine Bandou <yacine.bandou_ext@softathome.com> on 2018-05-22
Reviewed by Philippe Normand.

The ReadyState should not be set to HaveNothing when an error occurs in playback pipeline, because
at least we should have the metadata in order to have an error in pipeline.

Here is the definition of HaveNothing state in W3C spec https://dev.w3.org/html5/spec-preview/media-elements.html#ready-states
"HAVE_NOTHING (numeric value 0): No information regarding the media resource is available. No data for the current
playback position is available. Media elements whose networkState attribute is NETWORK_EMPTY are always in the HAVE_NOTHING state."

In MSE case, this patch fixes the crashes of the followings WPT encrypted-media tests:

  • clearkey-mp4-playback-temporary-clear-encrypted.https.html
  • clearkey-mp4-playback-temporary-multikey-sequential.https.html
  • clearkey-mp4-playback-temporary-multikey-sequential-readyState.https.html

Here is the cause of the crashes: When an error occurs in playback pipeline like no decipher key, in case of encrypted content,
the MediaPlayerPrivateGstreamer sets NetworkState to FormatError which causes the detachment of MediaElement from MediaSource,
then MediaPlayerPrivateGstreamer sets the ReadyState to HaveNothing which causes a trying again to play the same URI,
thus the crash occurs because the MediaElement is detached from MediaSource, see bugzilla for more details.
Note: these crashes should be fixed in 185242 but unfortunately it isn't the case. See bug 185242 for more details.

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:

(WebCore::MediaPlayerPrivateGStreamer::handleMessage):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r232058 r232061  
     12018-05-22  Yacine Bandou  <yacine.bandou_ext@softathome.com>
     2
     3        [GStreamer] Don't set the ReadyState to HaveNothing when an error occurs in playback pipeline
     4        https://bugs.webkit.org/show_bug.cgi?id=185725
     5
     6        Reviewed by Philippe Normand.
     7
     8        The ReadyState should not be set to HaveNothing when an error occurs in playback pipeline, because
     9        at least we should have the metadata in order to have an error in pipeline.
     10
     11        Here is the definition of HaveNothing state in W3C spec https://dev.w3.org/html5/spec-preview/media-elements.html#ready-states
     12        "HAVE_NOTHING (numeric value 0): No information regarding the media resource is available. No data for the current
     13        playback position is available. Media elements whose networkState attribute is NETWORK_EMPTY are always in the HAVE_NOTHING state."
     14
     15        In MSE case, this patch fixes the crashes of the followings WPT encrypted-media tests:
     16        - clearkey-mp4-playback-temporary-clear-encrypted.https.html
     17        - clearkey-mp4-playback-temporary-multikey-sequential.https.html
     18        - clearkey-mp4-playback-temporary-multikey-sequential-readyState.https.html
     19
     20        Here is the cause of the crashes: When an error occurs in playback pipeline like no decipher key, in case of encrypted content,
     21        the MediaPlayerPrivateGstreamer sets NetworkState to FormatError which causes the detachment of MediaElement from MediaSource,
     22        then MediaPlayerPrivateGstreamer sets the ReadyState to HaveNothing which causes a trying again to play the same URI,
     23        thus the crash occurs because the MediaElement is detached from MediaSource, see bugzilla for more details.
     24        Note: these crashes should be fixed in 185242 but unfortunately it isn't the case. See bug 185242 for more details.
     25
     26        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
     27        (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
     28
    1292018-05-22  Yacine Bandou  <yacine.bandou_ext@softathome.com>
    230
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

    r231891 r232061  
    11561156        if (attemptNextLocation)
    11571157            issueError = !loadNextLocation();
    1158         if (issueError)
    1159             loadingFailed(error);
     1158        if (issueError) {
     1159            m_errorOccured = true;
     1160            if (m_networkState != error) {
     1161                m_networkState = error;
     1162                m_player->networkStateChanged();
     1163            }
     1164        }
    11601165        break;
    11611166    case GST_MESSAGE_EOS:
Note: See TracChangeset for help on using the changeset viewer.