[Mplayer-cvslog] CVS: main/libmpdemux Makefile,1.61,1.62 demuxer.c,1.141,1.142 demuxer.h,1.59,1.60

Roberto Togni CVS rtognimp at mplayerhq.hu
Wed Apr 30 21:50:49 CEST 2003


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

Modified Files:
	Makefile demuxer.c demuxer.h 
Log Message:
Add support for Realaudio files

Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/Makefile,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- Makefile	30 Apr 2003 11:39:32 -0000	1.61
+++ Makefile	30 Apr 2003 19:50:46 -0000	1.62
@@ -3,7 +3,7 @@
 
 include ../config.mak
 
-SRCS = mp3_hdr.c video.c mpeg_hdr.c cache2.c asfheader.c aviheader.c aviprint.c muxer.c muxer_avi.c muxer_mpeg.c demux_asf.c demux_avi.c demux_mov.c parse_mp4.c demux_mpg.c demux_pva.c demux_viv.c demuxer.c dvdauth.c dvdnav_stream.c open.c parse_es.c stream.c stream_file.c stream_netstream.c stream_vcd.c stream_null.c tv.c tvi_dummy.c tvi_v4l.c tvi_bsdbt848.c frequencies.c demux_fli.c demux_real.c demux_y4m.c yuv4mpeg.c yuv4mpeg_ratio.c demux_nuv.c demux_film.c demux_roq.c mf.c demux_mf.c demux_audio.c demux_demuxers.c demux_ogg.c demux_bmp.c cdda.c demux_rawaudio.c demux_rawvideo.c cddb.c cdinfo.c demux_rawdv.c ai_alsa.c ai_oss.c audio_in.c demux_smjpeg.c cue_read.c extension.c demux_gif.c demux_ts.c
+SRCS = mp3_hdr.c video.c mpeg_hdr.c cache2.c asfheader.c aviheader.c aviprint.c muxer.c muxer_avi.c muxer_mpeg.c demux_asf.c demux_avi.c demux_mov.c parse_mp4.c demux_mpg.c demux_pva.c demux_viv.c demuxer.c dvdauth.c dvdnav_stream.c open.c parse_es.c stream.c stream_file.c stream_netstream.c stream_vcd.c stream_null.c tv.c tvi_dummy.c tvi_v4l.c tvi_bsdbt848.c frequencies.c demux_fli.c demux_real.c demux_y4m.c yuv4mpeg.c yuv4mpeg_ratio.c demux_nuv.c demux_film.c demux_roq.c mf.c demux_mf.c demux_audio.c demux_demuxers.c demux_ogg.c demux_bmp.c cdda.c demux_rawaudio.c demux_rawvideo.c cddb.c cdinfo.c demux_rawdv.c ai_alsa.c ai_oss.c audio_in.c demux_smjpeg.c cue_read.c extension.c demux_gif.c demux_ts.c demux_realaud.c
 ifeq ($(XMMS_PLUGINS),yes)
 SRCS += demux_xmms.c
 endif 

Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.c,v
retrieving revision 1.141
retrieving revision 1.142
diff -u -r1.141 -r1.142
--- demuxer.c	30 Apr 2003 11:39:32 -0000	1.141
+++ demuxer.c	30 Apr 2003 19:50:46 -0000	1.142
@@ -136,6 +136,7 @@
 extern void demux_close_gif(demuxer_t* demuxer);
 extern void demux_close_ts(demuxer_t* demuxer);
 extern void demux_close_mkv(demuxer_t* demuxer);
+extern void demux_close_ra(demuxer_t* demuxer);
 
 #ifdef USE_TV
 #include "tv.h"
@@ -212,6 +213,8 @@
 #endif
     case DEMUXER_TYPE_MPEG_TS:
       demux_close_ts(demuxer); break;
+    case DEMUXER_TYPE_REALAUDIO:
+      demux_close_ra(demuxer); break;
 
     }
     // free streams:
@@ -291,6 +294,7 @@
 int demux_xmms_fill_buffer(demuxer_t *demux,demux_stream_t *ds);
 int demux_gif_fill_buffer(demuxer_t *demux);
 int demux_ts_fill_buffer(demuxer_t *demux);
+int demux_ra_fill_buffer(demuxer_t *demux);
 
 extern int demux_demuxers_fill_buffer(demuxer_t *demux,demux_stream_t *ds);
 extern int demux_ogg_fill_buffer(demuxer_t *d);
@@ -349,6 +353,7 @@
     case DEMUXER_TYPE_GIF: return demux_gif_fill_buffer(demux);
 #endif
     case DEMUXER_TYPE_MPEG_TS: return demux_ts_fill_buffer(demux);
+    case DEMUXER_TYPE_REALAUDIO: return demux_ra_fill_buffer(demux);
   }
   return 0;
 }
@@ -584,6 +589,8 @@
 extern int demux_open_gif(demuxer_t* demuxer);
 extern int ts_check_file(demuxer_t * demuxer);
 extern int demux_open_mkv(demuxer_t *demuxer);
+extern int ra_check_file(demuxer_t *demuxer);
+extern int demux_open_ra(demuxer_t* demuxer);
 
 extern demuxer_t* init_avi_with_ogg(demuxer_t* demuxer);
 
@@ -723,6 +730,17 @@
   }
 }
 #endif
+//=============== Try to open as REALAUDIO file: =================
+if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_REALAUDIO){
+  demuxer=new_demuxer(stream,DEMUXER_TYPE_REALAUDIO,audio_id,video_id,dvdsub_id);
+  if(ra_check_file(demuxer)){
+      mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_Detected_XXX_FileFormat,"REALAUDIO");
+      file_format=DEMUXER_TYPE_REALAUDIO;
+  } else {
+      free_demuxer(demuxer);
+      demuxer = NULL;
+  }
+}
 
 //=============== Try based on filename EXTENSION: =================
 // Ok. We're over the stable detectable fileformats, the next ones are a bit
@@ -1202,6 +1220,10 @@
 #endif
  case DEMUXER_TYPE_MPEG_TS: {
   demux_open_ts(demuxer);
+  break;
+ }
+ case DEMUXER_TYPE_REALAUDIO: {
+  if (!demux_open_ra(demuxer)) return NULL;
   break;
  }
 } // switch(file_format)

Index: demuxer.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.h,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- demuxer.h	30 Apr 2003 11:39:32 -0000	1.59
+++ demuxer.h	30 Apr 2003 19:50:46 -0000	1.60
@@ -40,11 +40,12 @@
 #define DEMUXER_TYPE_MPEG_TS 29
 #define DEMUXER_TYPE_H264_ES 30
 #define DEMUXER_TYPE_MATROSKA 31
+#define DEMUXER_TYPE_REALAUDIO 32
 
 // This should always match the higest demuxer type number.
 // Unless you want to disallow users to force the demuxer to some types
 #define DEMUXER_TYPE_MIN 0
-#define DEMUXER_TYPE_MAX 31
+#define DEMUXER_TYPE_MAX 32
 
 #define DEMUXER_TYPE_DEMUXERS (1<<16)
 // A virtual demuxer type for the network code



More information about the MPlayer-cvslog mailing list