Improper treatment of percent escaped characters by gstsouphttpsrc
Krzysztof Konopko
krzysztof.konopko at youview.com
Fri Nov 23 02:37:21 PST 2012
On 22/11/12 22:37, Tim-Philipp Müller wrote:
> On Thu, 2012-11-22 at 21:20 +0000, Mateusz Kowalczyk wrote:
>> Not Found (404), URL: http://www.notarealurl.net/insub/%255Binsub05%255DJacques_Demierre-1-black_white_memories.mp3"
>
>> Stopping; old url_ is QUrl( "http://www.notarealurl.net/insub/%5Binsub05%5DJacques_Demierre-1-black_white_memories.mp3" )
>>
>> As can be seen above, I make sure a couple of times that the URL I have
>> is correct. Once GStreamer tries to reach it however, it reports a 404
>> error with a mangled URL (number 25 seems to be inserted for some
>> reason; I haven't tried with other escape codes).
>
> It looks like the % in %5B is getting escaped again, to %255B .
>
> Perhaps look at the GST_DEBUG log to see what's going on, and what URI
> is actually passed to GStreamer ?
>
> Cheers
> -Tim
>
Here's an experiment to try on the command line:
gst-launch-0.10 \
souphttpsrc \
location=http://www.notarealurl.net/insub/%5Binsub05%5DJacques_Demierre-1-black_white_memories.mp3
! fakesink
or
gst-launch-1.0 \
souphttpsrc \
location=http://www.notarealurl.net/insub/%5Binsub05%5DJacques_Demierre-1-black_white_memories.mp3
! fakesink
This should isolate the problem down to the GStreamer plugin you're
using in your pipeline. I tried both and I can't see any additional %.
You can also try it with a real URL and autoaudiosink instead of
fakesink to actually listen to the media.
Now according to your logs, you're using QUrl. According to the
documentation [1] (Qt 4.7):
QUrl::QUrl ( const QString & url )
Constructs a URL by parsing url. url is assumed to be in human readable
representation, with no percent encoding. QUrl will automatically
percent encode all characters that are not allowed in a URL.
It looks like QUrl escapes %. Try using QUrl::fromEncoded() instead.
I tried to look into the sourcode [2] but I'm not sure if this is the
right place. It looks like everywhere the URL is conveyed within QUrl
but maybe at some point QString is extracted and used to construct
another copy of QUrl?
[1] http://doc.qt.digia.com/qt/qurl.html#QUrl-2
[2]
http://code.google.com/p/clementine-player/source/browse/src/engines/gstengine.cpp?name=gstreamer-light
HTH,
Kris
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
More information about the gstreamer-devel
mailing list