[MPlayer-cvslog] r20964 - in trunk/libmpdemux: demuxer.c demuxer.h

nicodvb subversion at mplayerhq.hu
Thu Nov 16 22:23:07 CET 2006


Author: nicodvb
Date: Thu Nov 16 22:23:06 2006
New Revision: 20964

Modified:
   trunk/libmpdemux/demuxer.c
   trunk/libmpdemux/demuxer.h

Log:
added code to switch video stream

Modified: trunk/libmpdemux/demuxer.c
==============================================================================
--- trunk/libmpdemux/demuxer.c	(original)
+++ trunk/libmpdemux/demuxer.c	Thu Nov 16 22:23:06 2006
@@ -1079,6 +1079,13 @@
     return index;
 }
 
+int demuxer_switch_video(demuxer_t *demuxer, int index){
+    int res = demux_control(demuxer, DEMUXER_CTRL_SWITCH_VIDEO, &index);
+    if (res == DEMUXER_CTRL_NOTIMPL)
+      index = demuxer->video->id;
+    return index;
+}
+
 int demuxer_add_chapter(demuxer_t* demuxer, const char* name, uint64_t start, uint64_t end){
     if (demuxer->chapters == NULL)
         demuxer->chapters = malloc (32*sizeof(*demuxer->chapters));

Modified: trunk/libmpdemux/demuxer.h
==============================================================================
--- trunk/libmpdemux/demuxer.h	(original)
+++ trunk/libmpdemux/demuxer.h	Thu Nov 16 22:23:06 2006
@@ -78,6 +78,7 @@
 #define DEMUXER_CTRL_GET_PERCENT_POS 11
 #define DEMUXER_CTRL_SWITCH_AUDIO 12
 #define DEMUXER_CTRL_RESYNC 13
+#define DEMUXER_CTRL_SWITCH_VIDEO 14
 
 // Holds one packet/frame/whatever
 typedef struct demux_packet_st {
@@ -365,6 +366,7 @@
 extern double demuxer_get_time_length(demuxer_t *demuxer);
 extern int demuxer_get_percent_pos(demuxer_t *demuxer);
 extern int demuxer_switch_audio(demuxer_t *demuxer, int index);
+extern int demuxer_switch_video(demuxer_t *demuxer, int index);
 
 extern int demuxer_type_by_filename(char* filename);
 



More information about the MPlayer-cvslog mailing list