[phonon-gst] [PATCH] Problems with files that have URL-escaped characters.
Michael Pyne
mpyne at purinchu.net
Wed Aug 13 00:04:36 CEST 2008
On Tuesday 12 August 2008, Michael Pyne wrote:
> I suspect excess URL decoding somewhere along the line that has gone
> unnoticed up to this point, but I have not dug into the code yet.
The cause was as I thought. gst_element_make_from_uri expects a valid (i.e.
encoded) URI. The gchar * passed before the patch is derived from
QUrl::toString(), which is labeled as returning a decoded QString. What you
wanted to call was QUrl::toEncoded() which is described as useful for internal
use. Unfortunately these descriptions are in the class description and not
the documentation for each function (which instead merely describes what
exactly happens).
Either way since the function is createPipefromURL I passed the whole QUrl
instead of encoding it to QByteArray first since the toString form is useful
(in the error message) if the URL fails to load.
Note that I fixed a QString("%0...").arg() to read QString("%1...").arg() as
well.
Final note: This changes the method signature of a protected (but non-virtual)
function. MediaObject itself was the only user I found of the function but if
there's others out there it may be worth it to add the old method signature in
as well to avoid breaking binary compatibility.
Note: Patch is from the phonon-gst in phonon 4.2 branch.
Regards,
- Michael Pyne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/phonon-backends/attachments/20080812/9d81f16c/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-gst-uri-handling.patch
Type: text/x-patch
Size: 2615 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/phonon-backends/attachments/20080812/9d81f16c/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/phonon-backends/attachments/20080812/9d81f16c/attachment.pgp
More information about the Phonon-backends
mailing list