changeset 5084:2fd327bf64fc

added get_sh_video/audio and realmedia seeking
author alex
date Fri, 15 Mar 2002 15:53:11 +0000
parents ce6952225939
children 3d558414320f
files libmpdemux/demuxer.c libmpdemux/stheader.h
diffstat 2 files changed, 34 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demuxer.c	Fri Mar 15 15:51:37 2002 +0000
+++ b/libmpdemux/demuxer.c	Fri Mar 15 15:53:11 2002 +0000
@@ -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 @@
   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 @@
     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_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 @@
   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;
 
--- a/libmpdemux/stheader.h	Fri Mar 15 15:51:37 2002 +0000
+++ b/libmpdemux/stheader.h	Fri Mar 15 15:53:11 2002 +0000
@@ -78,8 +78,12 @@
   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);