Blob Blame Raw
diff -up webkitgtk-2.11.5/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp.orig webkitgtk-2.11.5/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
--- webkitgtk-2.11.5/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp.orig	2016-02-09 10:04:54.898217667 +0100
+++ webkitgtk-2.11.5/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2016-02-09 10:13:35.080875509 +0100
@@ -1734,7 +1734,7 @@ static HashSet<String, ASCIICaseInsensit
             "video/flv",
             "video/mj2",
             "video/mp2t",
-            "video/mp4",
+//            "video/mp4",
             "video/mpeg",
             "video/mpegts",
             "video/ogg",
@@ -1759,6 +1759,21 @@ static HashSet<String, ASCIICaseInsensit
         };
         for (auto& type : mimeTypes)
             set.add(type);
+
+        // Hack to make YouTube work, https://bugs.webkit.org/show_bug.cgi?id=135972
+        gint exit_status = 1;
+        GUniqueOutPtr<GError> error;
+        GUniqueOutPtr<char> stdout_to_discard;
+        GUniqueOutPtr<char> stderr_to_discard;
+        gboolean success = g_spawn_command_line_sync(
+            "rpm -qi gstreamer1-libav",
+            &stdout_to_discard.outPtr(),
+            &stderr_to_discard.outPtr(),
+            &exit_status,
+            &error.outPtr());
+        if (success && !error && !exit_status)
+            set.add(String::fromUTF8("video/mp4"));
+
         return set;
     }();
     return cache;