Changeset 249325 in webkit


Ignore:
Timestamp:
Aug 30, 2019 8:14:54 AM (5 years ago)
Author:
aboya@igalia.com
Message:

[MSE][GStreamer] Gracefully fail on invalid non-first initialization segment
https://bugs.webkit.org/show_bug.cgi?id=201322

Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

In normal operation of AppendPipeline, except during tear down,
qtdemux never removes a pad. Even if a new initialization segment is
appended, the pad is reused.

There is an exception though: when the new initialization segment has
an incompatible set of tracks. This is invalid under the MSE spec and
should produce an error, but in this case this was making an assertion
fail -- in particular by sending an EOS to the to-be-removed pad, which
AppendPipeline doesn't expect.

This patch changes the assertion with graceful error handling for that
error.

Fixes media/media-source/media-source-seek-detach-crash.html

  • platform/graphics/gstreamer/mse/AppendPipeline.cpp:

(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::handleErrorConditionFromStreamingThread):
(WebCore::AppendPipeline::handleErrorSyncMessage):

  • platform/graphics/gstreamer/mse/AppendPipeline.h:

LayoutTests:

  • platform/gtk/TestExpectations:
  • platform/wpe/TestExpectations:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r249320 r249325  
     12019-08-30  Alicia Boya García  <aboya@igalia.com>
     2
     3        [MSE][GStreamer] Gracefully fail on invalid non-first initialization segment
     4        https://bugs.webkit.org/show_bug.cgi?id=201322
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        * platform/gtk/TestExpectations:
     9        * platform/wpe/TestExpectations:
     10
    1112019-08-30  Joonghun Park  <jh718.park@samsung.com>
    212
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r249316 r249325  
    242242webkit.org/b/167108 imported/w3c/web-platform-tests/media-source/mediasource-trackdefault.html [ Failure ]
    243243webkit.org/b/167108 imported/w3c/web-platform-tests/media-source/mediasource-trackdefaultlist.html [ Failure ]
    244 
    245 # We don't support multiple streams per sourcebuffer nor dynamic type changes (audio/video/text)
    246 webkit.org/b/165394 media/media-source/media-source-seek-detach-crash.html [ Skip ]
    247244
    248245# There is an oggdemux bug that deadlocks WebKit: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/639
  • trunk/LayoutTests/platform/wpe/TestExpectations

    r248771 r249325  
    13121312webkit.org/b/171726 media/media-source/media-source-init-segment-duration.html [ Failure ]
    13131313webkit.org/b/168373 media/media-source/media-source-resize.html [ Failure ]
    1314 webkit.org/b/165394 media/media-source/media-source-seek-detach-crash.html [ Timeout ]
    13151314webkit.org/b/168373 media/media-source/only-bcp47-language-tags-accepted-as-valid.html [ Timeout ]
    13161315
  • trunk/Source/WebCore/ChangeLog

    r249321 r249325  
     12019-08-30  Alicia Boya García  <aboya@igalia.com>
     2
     3        [MSE][GStreamer] Gracefully fail on invalid non-first initialization segment
     4        https://bugs.webkit.org/show_bug.cgi?id=201322
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        In normal operation of AppendPipeline, except during tear down,
     9        qtdemux never removes a pad. Even if a new initialization segment is
     10        appended, the pad is reused.
     11
     12        There is an exception though: when the new initialization segment has
     13        an incompatible set of tracks. This is invalid under the MSE spec and
     14        should produce an error, but in this case this was making an assertion
     15        fail -- in particular by sending an EOS to the to-be-removed pad, which
     16        AppendPipeline doesn't expect.
     17
     18        This patch changes the assertion with graceful error handling for that
     19        error.
     20
     21        Fixes media/media-source/media-source-seek-detach-crash.html
     22
     23        * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
     24        (WebCore::AppendPipeline::AppendPipeline):
     25        (WebCore::AppendPipeline::handleErrorConditionFromStreamingThread):
     26        (WebCore::AppendPipeline::handleErrorSyncMessage):
     27        * platform/graphics/gstreamer/mse/AppendPipeline.h:
     28
    1292019-08-30  Charlie Turner  <cturner@igalia.com>
    230
  • trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp

    r249205 r249325  
    217217    }), this);
    218218    g_signal_connect(m_appsink.get(), "eos", G_CALLBACK(+[](GstElement*, AppendPipeline* appendPipeline) {
    219         // basesrc will emit an EOS after it has received a GST_FLOW_ERROR. That's the only case we are expecting.
    220         if (!appendPipeline->m_errorReceived) {
    221             GST_ERROR("Unexpected appsink EOS in AppendPipeline");
    222             ASSERT_NOT_REACHED();
    223         }
     219        if (appendPipeline->m_errorReceived)
     220            return;
     221
     222        GST_ERROR("AppendPipeline's appsink received EOS. This is usually caused by an invalid initialization segment.");
     223        appendPipeline->handleErrorConditionFromStreamingThread();
    224224    }), this);
    225225
     
    280280}
    281281
    282 void AppendPipeline::handleErrorSyncMessage(GstMessage* message)
     282void AppendPipeline::handleErrorConditionFromStreamingThread()
    283283{
    284284    ASSERT(!isMainThread());
    285     GST_WARNING_OBJECT(m_pipeline.get(), "Demuxing error: %" GST_PTR_FORMAT, message);
    286285    // Notify the main thread that the append has a decode error.
    287286    auto response = m_taskQueue.enqueueTaskAndWait<AbortableTaskQueue::Void>([this]() {
     
    293292    // The streaming thread has now been unblocked because we are aborting in the main thread.
    294293    ASSERT(!response);
     294}
     295
     296void AppendPipeline::handleErrorSyncMessage(GstMessage* message)
     297{
     298    ASSERT(!isMainThread());
     299    GST_WARNING_OBJECT(m_pipeline.get(), "Demuxing error: %" GST_PTR_FORMAT, message);
     300    handleErrorConditionFromStreamingThread();
    295301}
    296302
  • trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.h

    r249205 r249325  
    6868
    6969    void handleAppsinkNewSampleFromStreamingThread(GstElement*);
     70    void handleErrorConditionFromStreamingThread();
    7071
    7172    // Takes ownership of caps.
Note: See TracChangeset for help on using the changeset viewer.