Title: [216492] releases/WebKitGTK/webkit-2.14/Source/WebCore
Revision
216492
Author
carlo...@webkit.org
Date
2017-05-09 02:59:24 -0700 (Tue, 09 May 2017)

Log Message

Merge r216239 - [GStreamer] Fix handling of gst errors in MediaPlayerPrivateGStreamer::handleMessage
https://bugs.webkit.org/show_bug.cgi?id=171721

Reviewed by Xabier Rodriguez-Calvar.

We are checking the GError only comparing the code, and ignoring the domain in some cases. Use g_error_matches()
in those cases instead of only checking the code.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog (216491 => 216492)


--- releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog	2017-05-09 09:58:40 UTC (rev 216491)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog	2017-05-09 09:59:24 UTC (rev 216492)
@@ -1,3 +1,16 @@
+2017-05-05  Carlos Garcia Campos  <cgar...@igalia.com>
+
+        [GStreamer] Fix handling of gst errors in MediaPlayerPrivateGStreamer::handleMessage
+        https://bugs.webkit.org/show_bug.cgi?id=171721
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        We are checking the GError only comparing the code, and ignoring the domain in some cases. Use g_error_matches()
+        in those cases instead of only checking the code.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
+
 2017-05-02  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [GStreamer] Dailymotion live stream videos don't play

Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (216491 => 216492)


--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2017-05-09 09:58:40 UTC (rev 216491)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2017-05-09 09:59:24 UTC (rev 216492)
@@ -911,20 +911,19 @@
         GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(m_pipeline.get()), GST_DEBUG_GRAPH_SHOW_ALL, "webkit-video.error");
 
         error = MediaPlayer::Empty;
-        if (err->code == GST_STREAM_ERROR_CODEC_NOT_FOUND
-            || err->code == GST_STREAM_ERROR_WRONG_TYPE
-            || err->code == GST_STREAM_ERROR_FAILED
-            || err->code == GST_CORE_ERROR_MISSING_PLUGIN
-            || err->code == GST_RESOURCE_ERROR_NOT_FOUND)
+        if (g_error_matches(err.get(), GST_STREAM_ERROR, GST_STREAM_ERROR_CODEC_NOT_FOUND)
+            || g_error_matches(err.get(), GST_STREAM_ERROR, GST_STREAM_ERROR_WRONG_TYPE)
+            || g_error_matches(err.get(), GST_STREAM_ERROR, GST_STREAM_ERROR_FAILED)
+            || g_error_matches(err.get(), GST_CORE_ERROR, GST_CORE_ERROR_MISSING_PLUGIN)
+            || g_error_matches(err.get(), GST_RESOURCE_ERROR, GST_RESOURCE_ERROR_NOT_FOUND))
             error = MediaPlayer::FormatError;
-        else if (err->domain == GST_STREAM_ERROR) {
+        else if (g_error_matches(err.get(), GST_STREAM_ERROR, GST_STREAM_ERROR_TYPE_NOT_FOUND)) {
             // Let the mediaPlayerClient handle the stream error, in
             // this case the HTMLMediaElement will emit a stalled
             // event.
-            if (err->code == GST_STREAM_ERROR_TYPE_NOT_FOUND) {
-                GST_ERROR("Decode error, let the Media element emit a stalled event.");
-                break;
-            }
+            GST_ERROR("Decode error, let the Media element emit a stalled event.");
+            break;
+        } else if (err->domain == GST_STREAM_ERROR) {
             error = MediaPlayer::DecodeError;
             attemptNextLocation = true;
         } else if (err->domain == GST_RESOURCE_ERROR)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to