diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-01-06 03:30:02 +0000 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-01-06 03:30:02 +0000 |
commit | ff632b94b6b25c35239ebb49a8e123d11f2fa8f4 (patch) | |
tree | 2e1a1cab9a15a9b95b28f89f35f108d162166e53 | |
parent | 051c124db8a2ab27f45530323d9cbd673e277794 (diff) | |
download | xine-lib-ff632b94b6b25c35239ebb49a8e123d11f2fa8f4.tar.gz xine-lib-ff632b94b6b25c35239ebb49a8e123d11f2fa8f4.tar.bz2 |
Tell the Real demuxer about lists of http references.
Such broken wrong-extension wrong-MIME-type lists exist in the wild...
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | src/demuxers/demux_real.c | 22 |
2 files changed, 17 insertions, 7 deletions
@@ -27,7 +27,7 @@ xine-lib (1.1.9) (unreleased) (This was broken by ffmpeg revision 9283). * Enabled the WMV VC1 & VMware Screen (ffmpeg) codecs. * Fixed a crash that happened when a video output was closed - * Made the Real demuxer recognise http references. + * Made the Real demuxer recognise simple lists of http references. * Require correct URL encoding of '#'s which aren't separators. * Don't decode %nn in raw filenames. [Bug 1784272] * Always enable a52dec capabilities for external a52dec, this makes it diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c index 85d7dc5a3..9206bfc74 100644 --- a/src/demuxers/demux_real.c +++ b/src/demuxers/demux_real.c @@ -806,12 +806,22 @@ static int demux_real_parse_references( demux_real_t *this) { if (!strncmp(buf,"http://",7)) { - for (i = 0; buf[i] && !isspace(buf[i]); ++i) - /**/; - buf[i] = 0; - lprintf("reference [%s] found\n", buf); - - _x_demux_send_mrl_reference (this->stream, 0, buf, NULL, 0, 0); + i = 0; + while (buf[i]) + { + j = i; + while (buf[i] && !isspace(buf[i])) + ++i; /* skip non-space */ + len = buf[i]; + buf[i] = 0; + if (strncmp (buf + j, "http://", 7) || (i - j) < 8) + break; /* stop at the first non-http reference */ + lprintf("reference [%s] found\n", buf + j); + _x_demux_send_mrl_reference (this->stream, 0, buf + j, NULL, 0, 0); + buf[i] = (char) len; + while (buf[i] && isspace(buf[i])) + ++i; /* skip spaces */ + } } else for (i = 0; i < buf_used; ++i) { |