From: Philippe Normand Date: Tue, 8 Mar 2022 12:04:41 +0000 (+0000) Subject: typefind: Skip parsing of data URIs X-Git-Tag: 1.22.0~2130 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2Fgstreamer.git;a=commitdiff_plain;h=b8ccf7f80283d06841a0b191be940f7ab78940c8 typefind: Skip parsing of data URIs Commit a46ab2ced20d757e0e770d4de1edc3a152cc4f2f introduced a regression, breaking typefinding for media content muxed in mp4 container and serialized to data URIs. For this case it doesn't make sense to look for a file extension, so skip URI parsing. Part-of: --- diff --git a/subprojects/gstreamer/plugins/elements/gsttypefindelement.c b/subprojects/gstreamer/plugins/elements/gsttypefindelement.c index 84e60a9..41dedb2 100644 --- a/subprojects/gstreamer/plugins/elements/gsttypefindelement.c +++ b/subprojects/gstreamer/plugins/elements/gsttypefindelement.c @@ -803,6 +803,8 @@ gst_type_find_get_extension (GstTypeFindElement * typefind, GstPad * pad) gchar *uri, *result, *path, *base_path, *find; GstUri *gst_uri; + base_path = NULL; + query = gst_query_new_uri (); /* try getting the caps with an uri query and from the extension */ @@ -813,6 +815,11 @@ gst_type_find_get_extension (GstTypeFindElement * typefind, GstPad * pad) if (uri == NULL) goto no_uri; + /* data URIs paths are opaque and do not semantically represent a + filesystem-like resource path, so skip URI parsing for this case. */ + if (g_str_has_prefix (uri, "data:")) + goto no_extension; + GST_DEBUG_OBJECT (typefind, "finding extension of %s", uri); gst_uri = gst_uri_from_string (uri);