From dac77448881146c5bd4df0346cd152fa3b6fce9a Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 17 Mar 2013 10:16:49 +0000 Subject: 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. --- stream/http.c | 6 ++++++ 1 file changed, 6 insertions(+) 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"); -- cgit v1.2.3