changeset 10033:4ecb40d73e24

Add support for Realaudio files
author rtognimp
date Wed, 30 Apr 2003 19:50:46 +0000
parents 392ce6c74cd5
children 4f434f04b5bf
files libmpdemux/Makefile libmpdemux/demuxer.c libmpdemux/demuxer.h
diffstat 3 files changed, 25 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/Makefile	Wed Apr 30 19:48:38 2003 +0000
+++ b/libmpdemux/Makefile	Wed Apr 30 19:50:46 2003 +0000
@@ -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 
--- a/libmpdemux/demuxer.c	Wed Apr 30 19:48:38 2003 +0000
+++ b/libmpdemux/demuxer.c	Wed Apr 30 19:50:46 2003 +0000
@@ -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
@@ -1204,6 +1222,10 @@
   demux_open_ts(demuxer);
   break;
  }
+ case DEMUXER_TYPE_REALAUDIO: {
+  if (!demux_open_ra(demuxer)) return NULL;
+  break;
+ }
 } // switch(file_format)
 pts_from_bps=0; // !!!
 return demuxer;
--- a/libmpdemux/demuxer.h	Wed Apr 30 19:48:38 2003 +0000
+++ b/libmpdemux/demuxer.h	Wed Apr 30 19:50:46 2003 +0000
@@ -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