summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2013-03-17 10:16:49 +0000
committerwm4 <wm4@nowhere>2013-04-04 14:04:27 +0200
commitdac77448881146c5bd4df0346cd152fa3b6fce9a (patch)
treed83faa3d2ea5293dc8adecc6fc4af1a90fc3fd44
parent3dedcdde601ae22ebfd5b2a7d6909ecdc0c34312 (diff)
downloadmpv-dac77448881146c5bd4df0346cd152fa3b6fce9a.tar.bz2
mpv-dac77448881146c5bd4df0346cd152fa3b6fce9a.tar.xz
http: fix for broken SHOUTcast streams
Support broken icy-metaint response from QuickTime Streaming Server. The full version string is "QuickTime Streaming Server 6.1.0/532". It sends a HTTP response header that contains an MP3 header! Fixes bug #2133. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35987 b3059339-0415-0410-9bf9-f77b7e298cf2 Note that in mpv, "http://" is mapped to ffmpeg currently, and this code is unused by default.
-rw-r--r--stream/http.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/stream/http.c b/stream/http.c
index bb96739c45..c94d6d4925 100644
--- a/stream/http.c
+++ b/stream/http.c
@@ -430,6 +430,12 @@ http_response_parse( HTTP_header_t *http_hdr ) {
while( *ptr!='\r' && *ptr!='\n' ) ptr++;
len = ptr-hdr_ptr;
if( len==0 ) break;
+ if (len > 16 && !strncasecmp(hdr_ptr + 4, "icy-metaint:", 12))
+ {
+ mp_msg(MSGT_NETWORK, MSGL_WARN, "Server sent a severely broken icy-metaint HTTP header!\n");
+ hdr_ptr += 4;
+ len -= 4;
+ }
field = realloc(field, len+1);
if( field==NULL ) {
mp_msg(MSGT_NETWORK,MSGL_ERR,"Memory allocation failed\n");