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.
This commit is contained in:
reimar 2013-03-17 10:16:49 +00:00 committed by wm4
parent 3dedcdde60
commit dac7744888
1 changed files with 6 additions and 0 deletions

View File

@ -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");