# HG changeset patch # User cboesch # Date 1290679263 0 # Node ID 6831999478227226ab0e32fe2f1e8d35513c89eb # Parent 34215c3e6e1060268b9ac6e5424a4e23ee61791e Simplify mime_type_table loop diff -r 34215c3e6e10 -r 683199947822 stream/http.c --- a/stream/http.c Tue Nov 23 14:44:26 2010 +0000 +++ b/stream/http.c Thu Nov 25 10:01:03 2010 +0000 @@ -762,7 +762,6 @@ //! If this function succeeds you must closesocket stream->fd static int http_streaming_start(stream_t *stream, int* file_format) { HTTP_header_t *http_hdr = NULL; - unsigned int i; int fd = stream->fd; int res = STREAM_UNSUPPORTED; int redirect = 0; @@ -851,16 +850,16 @@ // Look if we can use the Content-Type content_type = http_get_field( http_hdr, "Content-Type" ); if( content_type!=NULL ) { + unsigned int i; + mp_msg(MSGT_NETWORK,MSGL_V,"Content-Type: [%s]\n", content_type ); // Check in the mime type table for a demuxer type - i = 0; - while(mime_type_table[i].mime_type != NULL) { + for (i = 0; mime_type_table[i].mime_type != NULL; i++) { if( !strcasecmp( content_type, mime_type_table[i].mime_type ) ) { *file_format = mime_type_table[i].demuxer_type; res = seekable; goto out; } - i++; } } // Not found in the mime type table, don't fail,