diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-01-25 15:59:53 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-01-25 15:59:53 +0200 |
commit | e28e4a1b157bd0e9620fcff956d713a9921f506c (patch) | |
tree | d92e54e1e25feb84e692396cf234478f403e5738 /stream/http.c | |
parent | 560acfd0407c757e17bf72b490687d4947b05675 (diff) | |
parent | 213092c8dcfc925d8d54cf320b60cf298a870696 (diff) | |
download | mpv-e28e4a1b157bd0e9620fcff956d713a9921f506c.tar.bz2 mpv-e28e4a1b157bd0e9620fcff956d713a9921f506c.tar.xz |
Merge svn changes up to r30419
Diffstat (limited to 'stream/http.c')
-rw-r--r-- | stream/http.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/stream/http.c b/stream/http.c index 117c531e4c..f993fee179 100644 --- a/stream/http.c +++ b/stream/http.c @@ -743,6 +743,7 @@ static int http_streaming_start(stream_t *stream, int* file_format) { int auth_retry=0; int seekable=0; char *content_type; + const char *content_length; char *next_url; URL_t *url = stream->streaming_ctrl->url; @@ -816,15 +817,15 @@ static int http_streaming_start(stream_t *stream, int* file_format) { // Assume standard http if not ICY switch( http_hdr->status_code ) { case 200: // OK + content_length = http_get_field(http_hdr, "Content-Length"); + if (content_length) { + mp_msg(MSGT_NETWORK,MSGL_V,"Content-Length: [%s]\n", content_length); + stream->end_pos = atoll(content_length); + } // Look if we can use the Content-Type content_type = http_get_field( http_hdr, "Content-Type" ); if( content_type!=NULL ) { - char *content_length = NULL; mp_msg(MSGT_NETWORK,MSGL_V,"Content-Type: [%s]\n", content_type ); - if( (content_length = http_get_field(http_hdr, "Content-Length")) != NULL) { - mp_msg(MSGT_NETWORK,MSGL_V,"Content-Length: [%s]\n", http_get_field(http_hdr, "Content-Length")); - stream->end_pos = atoi(content_length); - } // Check in the mime type table for a demuxer type i = 0; while(mime_type_table[i].mime_type != NULL) { |