[Mplayer-cvslog] CVS: main/libmpdemux demuxer.c,1.79,1.80 stheader.h,1.25,1.26

Alex Beregszaszi alex at mplayer.dev.hu
Fri Mar 15 16:53:13 CET 2002


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

Modified Files:
	demuxer.c stheader.h 
Log Message:
added get_sh_video/audio and realmedia seeking

Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -r1.79 -r1.80
--- demuxer.c	14 Mar 2002 11:18:19 -0000	1.79
+++ demuxer.c	15 Mar 2002 15:53:11 -0000	1.80
@@ -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);
 
@@ -901,6 +926,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;

Index: stheader.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/stheader.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- stheader.h	7 Mar 2002 02:49:46 -0000	1.25
+++ stheader.h	15 Mar 2002 15:53:11 -0000	1.26
@@ -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);




More information about the MPlayer-cvslog mailing list