[Mplayer-cvslog] CVS: main mplayer.c,1.145,1.146

Bertrand Baudet bertrand at users.sourceforge.net
Mon Jun 4 19:58:34 CEST 2001


Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv19022

Modified Files:
	mplayer.c 
Log Message:
Streaming function return the file_format and should be tested. 


Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.145
retrieving revision 1.146
diff -C2 -r1.145 -r1.146
*** mplayer.c	2001/06/04 00:36:55	1.145
--- mplayer.c	2001/06/04 17:58:32	1.146
***************
*** 645,656 ****
  #ifdef STREAMING
        } else {
!         int streaming_protocol;
!         streaming_protocol=autodetectProtocol( url, &f );
!         if( streaming_protocol==STREAMING_TYPE_UNKNOWN ) { 
            printf("Unable to open URL: %s\n", filename);
            url_free(url);
            return 1; 
          } else {
!           f=streaming_start( &url, f, streaming_protocol );
            if(f<0){ printf("Unable to open URL: %s\n", url->url); return 1; }
            printf("Connected to server: %s\n", url->hostname );
--- 645,655 ----
  #ifdef STREAMING
        } else {
!         file_format=autodetectProtocol( url, &f );
!         if( file_format==DEMUXER_TYPE_UNKNOWN ) { 
            printf("Unable to open URL: %s\n", filename);
            url_free(url);
            return 1; 
          } else {
!           f=streaming_start( &url, f, file_format );
            if(f<0){ printf("Unable to open URL: %s\n", url->url); return 1; }
            printf("Connected to server: %s\n", url->hostname );
***************
*** 685,688 ****
--- 684,706 ----
  
  //=============== Try to open as AVI file: =================
+ #ifdef STREAMING
+ if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_AVI){
+   stream_reset(stream);
+   demuxer=new_demuxer(stream,DEMUXER_TYPE_AVI,audio_id,video_id,dvdsub_id);
+   stream_seek(demuxer->stream,seek_to_byte);
+   //printf("stream3=0x%X vs. 0x%X\n",demuxer->stream,stream);
+   { //---- RIFF header:
+     int id=stream_read_dword_le(demuxer->stream); // "RIFF"
+     if(id==mmioFOURCC('R','I','F','F')){
+       stream_read_dword_le(demuxer->stream); //filesize
+       id=stream_read_dword_le(demuxer->stream); // "AVI "
+       if(id==formtypeAVI){ 
+         printf("Detected AVI file format!\n");
+         file_format=DEMUXER_TYPE_AVI;
+       }
+     }
+   }
+ }
+ #else
  stream_reset(stream);
  demuxer=new_demuxer(stream,DEMUXER_TYPE_AVI,audio_id,video_id,dvdsub_id);
***************
*** 700,705 ****
--- 718,728 ----
    }
  }
+ #endif
  //=============== Try to open as ASF file: =================
+ #ifdef STREAMING
+ if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_ASF){
+ #else
  if(file_format==DEMUXER_TYPE_UNKNOWN){
+ #endif
    stream_reset(stream);
    demuxer=new_demuxer(stream,DEMUXER_TYPE_ASF,audio_id,video_id,dvdsub_id);
***************
*** 711,715 ****
--- 734,742 ----
  }
  //=============== Try to open as MPEG-PS file: =================
+ #ifdef STREAMING
+ if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_MPEG_PS){
+ #else
  if(file_format==DEMUXER_TYPE_UNKNOWN){
+ #endif
    stream_reset(stream);
    demuxer=new_demuxer(stream,DEMUXER_TYPE_MPEG_PS,audio_id,video_id,dvdsub_id);


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list