[MPlayer-cvslog] r32644 - trunk/stream/http.c

cboesch subversion at mplayerhq.hu
Thu Nov 25 11:01:04 CET 2010


Author: cboesch
Date: Thu Nov 25 11:01:03 2010
New Revision: 32644

Log:
Simplify mime_type_table loop

Modified:
   trunk/stream/http.c

Modified: trunk/stream/http.c
==============================================================================
--- trunk/stream/http.c	Tue Nov 23 15:44:26 2010	(r32643)
+++ trunk/stream/http.c	Thu Nov 25 11:01:03 2010	(r32644)
@@ -762,7 +762,6 @@ static void print_icy_metadata(HTTP_head
 //! 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 @@ static int http_streaming_start(stream_t
 				// 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,


More information about the MPlayer-cvslog mailing list