[Mplayer-cvslog] CVS: main/libmpdemux network.c,1.33,1.34 network.h,1.10,1.11 open.c,1.37,1.38

Alex Beregszaszi alex at mplayer.dev.hu
Sat Feb 16 22:49:03 CET 2002


Update of /cvsroot/mplayer/main/libmpdemux
In directory mplayer:/var/tmp.root/cvs-serv22044

Modified Files:
	network.c network.h open.c 
Log Message:
fixed MP3 ICY detection, return detected file format for open_stream

Index: network.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/network.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- network.c	11 Feb 2002 05:16:09 -0000	1.33
+++ network.c	16 Feb 2002 21:48:59 -0000	1.34
@@ -34,7 +34,7 @@
 	int demuxer_type;
 } mime_type_table[] = {
 	// MP3 streaming, some MP3 streaming server answer with audio/mpeg
-	{ "audio/mpeg", DEMUXER_TYPE_MPEG_PS },
+	{ "audio/mpeg", DEMUXER_TYPE_AUDIO },
 	// MPEG streaming
 	{ "video/mpeg", DEMUXER_TYPE_MPEG_PS },
 	// AVI ??? => video/x-msvideo
@@ -68,6 +68,8 @@
 	{ "viv", DEMUXER_TYPE_VIVO },
 	{ "rm", DEMUXER_TYPE_REAL },
 	{ "y4m", DEMUXER_TYPE_Y4M },
+	{ "mp3", DEMUXER_TYPE_AUDIO },
+	{ "wav", DEMUXER_TYPE_AUDIO },
 };
 
 streaming_ctrl_t *
@@ -400,7 +402,7 @@
 			// Check if the response is an ICY status_code reason_phrase
 			if( !strcasecmp(http_hdr->protocol, "ICY") ) {
 				// Ok, we have detected an mp3 streaming
-				*file_format = DEMUXER_TYPE_MPEG_PS;
+				*file_format = DEMUXER_TYPE_AUDIO;
 				return 0;
 			}
 			
@@ -658,7 +660,7 @@
 }
 
 int
-streaming_start(stream_t *stream, int demuxer_type, URL_t *url) {
+streaming_start(stream_t *stream, int *demuxer_type, URL_t *url) {
 	int ret;
 	if( stream==NULL ) return -1;
 
@@ -667,7 +669,7 @@
 		return -1;
 	}
 	stream->streaming_ctrl->url = check4proxies( url );
-	ret = autodetectProtocol( stream->streaming_ctrl, &stream->fd, &demuxer_type );
+	ret = autodetectProtocol( stream->streaming_ctrl, &stream->fd, demuxer_type );
 	if( ret<0 ) {
 		return -1;
 	}
@@ -683,7 +685,7 @@
 		ret = rtp_streaming_start( stream );
 	} else
 	// For connection-oriented streams, we can usually determine the streaming type.
-	switch( demuxer_type ) {
+	switch( *demuxer_type ) {
 		case DEMUXER_TYPE_ASF:
 			// Send the appropriate HTTP request
 			// Need to filter the network stream.
@@ -693,10 +695,17 @@
 				printf("asf_streaming_start failed\n");
 			}
 			break;
-		case DEMUXER_TYPE_AVI:
-		case DEMUXER_TYPE_MOV:
 		case DEMUXER_TYPE_MPEG_ES:
 		case DEMUXER_TYPE_MPEG_PS:
+		case DEMUXER_TYPE_AVI:
+		case DEMUXER_TYPE_MOV:
+		case DEMUXER_TYPE_VIVO:
+		case DEMUXER_TYPE_FLI:
+		case DEMUXER_TYPE_REAL:
+		case DEMUXER_TYPE_Y4M:
+		case DEMUXER_TYPE_FILM:
+		case DEMUXER_TYPE_ROQ:
+		case DEMUXER_TYPE_AUDIO:
 		case DEMUXER_TYPE_UNKNOWN:
 			// Generic start, doesn't need to filter
 			// the network stream, it's a raw stream

Index: network.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/network.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- network.h	19 Jan 2002 09:04:02 -0000	1.10
+++ network.h	16 Feb 2002 21:48:59 -0000	1.11
@@ -38,7 +38,7 @@
 	void *data;
 } streaming_ctrl_t;
 
-//int streaming_start( stream_t *stream, int demuxer_type, URL_t *url );
+//int streaming_start( stream_t *stream, int *demuxer_type, URL_t *url );
 
 int streaming_bufferize( streaming_ctrl_t *streaming_ctrl, char *buffer, int size);
 

Index: open.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/open.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- open.c	6 Feb 2002 20:16:35 -0000	1.37
+++ open.c	16 Feb 2002 21:48:59 -0000	1.38
@@ -410,7 +410,7 @@
   url = url_new(filename);
   if(url) {
         stream=new_stream(f,STREAMTYPE_STREAM);
-	if( streaming_start( stream, *file_format, url )<0){
+	if( streaming_start( stream, file_format, url )<0){
           mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_UnableOpenURL, filename);
 	  url_free(url);
 	  return NULL;




More information about the MPlayer-cvslog mailing list