added code to switch video stream

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20964 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
nicodvb 2006-11-16 21:23:06 +00:00
parent 7ddcc3ef32
commit 96e829fc9c
2 changed files with 9 additions and 0 deletions

View File

@ -1079,6 +1079,13 @@ int demuxer_switch_audio(demuxer_t *demuxer, int index){
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));

View File

@ -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 int demuxer_get_current_time(demuxer_t *demuxer);
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);