aboutsummaryrefslogtreecommitdiffhomepage
path: root/libmpdemux
diff options
context:
space:
mode:
authorGravatar rtognimp <rtognimp@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-04-30 19:50:46 +0000
committerGravatar rtognimp <rtognimp@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-04-30 19:50:46 +0000
commit5b0d3c5971ee93ea194993a4c5f23d54782a4633 (patch)
treedab3b8c505edc7265c179848391dc34070a44ecb /libmpdemux
parent724cc2157725940208ddfa9d99d689074c1d4613 (diff)
Add support for Realaudio files
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10034 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/Makefile2
-rw-r--r--libmpdemux/demuxer.c22
-rw-r--r--libmpdemux/demuxer.h3
3 files changed, 25 insertions, 2 deletions
diff --git a/libmpdemux/Makefile b/libmpdemux/Makefile
index 66050f65cc..4cbc09eb78 100644
--- a/libmpdemux/Makefile
+++ b/libmpdemux/Makefile
@@ -3,7 +3,7 @@ LIBNAME = libmpdemux.a
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
diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c
index 9cc603fd4a..7f0b89b2d4 100644
--- a/libmpdemux/demuxer.c
+++ b/libmpdemux/demuxer.c
@@ -136,6 +136,7 @@ extern void demux_close_xmms(demuxer_t* demuxer);
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 @@ void free_demuxer(demuxer_t *demuxer){
#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_pva_fill_buffer(demuxer_t *demux);
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 @@ int demux_fill_buffer(demuxer_t *demux,demux_stream_t *ds){
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 gif_check_file(demuxer_t *demuxer);
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 @@ if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_MATROSKA){
}
}
#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 @@ switch(file_format){
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;
diff --git a/libmpdemux/demuxer.h b/libmpdemux/demuxer.h
index 448ffab9ae..2e813be9db 100644
--- a/libmpdemux/demuxer.h
+++ b/libmpdemux/demuxer.h
@@ -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