typefind: fix reading file extension from URI
authorMarcin Kolny <marcin.kolny@gmail.com>
Thu, 4 Nov 2021 09:30:31 +0000 (09:30 +0000)
committerMarcin Kolny <marcin.kolny@gmail.com>
Thu, 4 Nov 2021 09:30:31 +0000 (09:30 +0000)
commita46ab2ced20d757e0e770d4de1edc3a152cc4f2f
tree090cb6578c359898a4092cb0b4721f70ff0b6f3f
parenta7b376011b3de28c333e9b738d7bd6fd585935c5
typefind: fix reading file extension from URI

Currently reading extension relies on the fact that everything after the
last"." character is a file extension. Whereas that works fine for most
of the cases, it breaks when the URI contains a query part.

E.g.: `http://url.com/file.mp4?param=value` returns `mp4?param=value`
instead of `mp4`.

In this commit we use URI parser to read the path of the URI (in the example
above, that is `/file.mp4`) and read extension from that path.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1305>
subprojects/gstreamer/plugins/elements/gsttypefindelement.c