diff options
author | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-03-15 15:53:11 +0000 |
---|---|---|
committer | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-03-15 15:53:11 +0000 |
commit | d8c34022bba88f0a9318582c1ad47ab1e9ac20d2 (patch) | |
tree | b7ae1608ee536d36cd134a4cf0a2f5d1cab3e23a /libmpdemux | |
parent | 19332211ba97ace88d25e19d36cf4539a1e04454 (diff) |
added get_sh_video/audio and realmedia seeking
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5085 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/demuxer.c | 32 | ||||
-rw-r--r-- | libmpdemux/stheader.h | 4 |
2 files changed, 34 insertions, 2 deletions
diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c index e68ee5aebf..c42bead636 100644 --- a/libmpdemux/demuxer.c +++ b/libmpdemux/demuxer.c @@ -18,6 +18,8 @@ #include "stheader.h" #include "mf.h" +#include "../libvo/fastmemcpy.h" + void free_demuxer_stream(demux_stream_t *ds){ ds_free_packs(ds); free(ds); @@ -67,8 +69,19 @@ demuxer_t* new_demuxer(stream_t *stream,int type,int a_id,int v_id,int s_id){ return d; } +sh_audio_t *get_sh_audio(demuxer_t *demuxer, int id) +{ + if(id > MAX_A_STREAMS-1 || id < 0) + { + mp_msg(MSGT_DEMUXER,MSGL_WARN,"Requested audio stream id overflow (%d > %d)\n", + id, MAX_A_STREAMS); + return NULL; + } + return demuxer->a_streams[id]; +} + sh_audio_t* new_sh_audio(demuxer_t *demuxer,int id){ - if(id > MAX_A_STREAMS-1) + if(id > MAX_A_STREAMS-1 || id < 0) { mp_msg(MSGT_DEMUXER,MSGL_WARN,"Requested audio stream id overflow (%d > %d)\n", id, MAX_A_STREAMS); @@ -91,8 +104,19 @@ void free_sh_audio(sh_audio_t* sh){ free(sh); } +sh_video_t *get_sh_video(demuxer_t *demuxer, int id) +{ + if(id > MAX_V_STREAMS-1 || id < 0) + { + mp_msg(MSGT_DEMUXER,MSGL_WARN,"Requested video stream id overflow (%d > %d)\n", + id, MAX_V_STREAMS); + return NULL; + } + return demuxer->v_streams[id]; +} + sh_video_t* new_sh_video(demuxer_t *demuxer,int id){ - if(id > MAX_V_STREAMS-1) + if(id > MAX_V_STREAMS-1 || id < 0) { mp_msg(MSGT_DEMUXER,MSGL_WARN,"Requested video stream id overflow (%d > %d)\n", id, MAX_V_STREAMS); @@ -851,6 +875,7 @@ int demux_seek_fli(demuxer_t *demuxer,float rel_seek_secs,int flags); int demux_seek_mf(demuxer_t *demuxer,float rel_seek_secs,int flags); int demux_seek_nuv(demuxer_t *demuxer,float rel_seek_secs,int flags); void demux_seek_mov(demuxer_t *demuxer,float pts,int flags); +int demux_seek_real(demuxer_t *demuxer,float rel_seek_secs,int flags); extern void demux_audio_seek(demuxer_t *demuxer,float rel_seek_secs,int flags); extern void demux_demuxers_seek(demuxer_t *demuxer,float rel_seek_secs,int flags); @@ -902,6 +927,9 @@ switch(demuxer->file_format){ case DEMUXER_TYPE_MOV: demux_seek_mov(demuxer,rel_seek_secs,flags); break; + case DEMUXER_TYPE_REAL: + demux_seek_real(demuxer,rel_seek_secs,flags); break; + case DEMUXER_TYPE_Y4M: demux_seek_y4m(demuxer,rel_seek_secs,flags); break; diff --git a/libmpdemux/stheader.h b/libmpdemux/stheader.h index fd2b0bd17f..0eb602fa55 100644 --- a/libmpdemux/stheader.h +++ b/libmpdemux/stheader.h @@ -78,8 +78,12 @@ typedef struct { void* video_out; } sh_video_t; +sh_audio_t* get_sh_audio(demuxer_t *demuxer,int id); +sh_video_t* get_sh_video(demuxer_t *demuxer,int id); sh_audio_t* new_sh_audio(demuxer_t *demuxer,int id); sh_video_t* new_sh_video(demuxer_t *demuxer,int id); +void free_sh_audio(sh_audio_t *sh); +void free_sh_video(sh_video_t *sh); int video_read_properties(sh_video_t *sh_video); int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char** start,int force_fps); |