Skip to content

Commit 71fc3fd

Browse files
asurdej-comcastphiln
authored andcommitted
Prefer webkit decryptors
1 parent 7bf0be6 commit 71fc3fd

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

Source/WebCore/platform/graphics/gstreamer/eme/WebKitThunderParser.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,17 @@ static void webkitMediaThunderParserConstructed(GObject* object)
110110
self->priv->parser = makeGStreamerElement("parsebin"_s, "inner-parser"_s);
111111

112112
auto factories = gst_element_factory_list_get_elements(GST_ELEMENT_FACTORY_TYPE_DECRYPTOR, GST_RANK_MARGINAL);
113-
factories = g_list_sort(factories, gst_plugin_feature_rank_compare_func);
113+
factories = g_list_sort(factories, [](gconstpointer p1, gconstpointer p2) -> gint {
114+
GstPluginFeature *f1, *f2;
115+
const gchar* name;
116+
f1 = (GstPluginFeature *) p1;
117+
f2 = (GstPluginFeature *) p2;
118+
if ((name = gst_plugin_feature_get_name(f1)) && g_str_has_prefix(name, "webkit"))
119+
return -1;
120+
if ((name = gst_plugin_feature_get_name(f2)) && g_str_has_prefix(name, "webkit"))
121+
return 1;
122+
return gst_plugin_feature_rank_compare_func(p1, p2);
123+
});
114124
for (GList* tmp = factories; tmp; tmp = tmp->next) {
115125
auto factory = GST_ELEMENT_FACTORY_CAST(tmp->data);
116126
self->priv->decryptor = gst_element_factory_create(factory, nullptr);

0 commit comments

Comments
 (0)