diff options
author | nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-11-19 23:10:30 +0000 |
---|---|---|
committer | nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-11-19 23:10:30 +0000 |
commit | f12bae62c086e565ba72f534495a55f75159ee6d (patch) | |
tree | fcddd5cf1c5dfcd0ccca9d44d9e63c273e9f7435 /libmpdemux | |
parent | 598d5be3ad6c53edb7c9db47ec04ca9b006e1056 (diff) |
during DEMUXER_CTRL_SWITCH_x *arg set to -2 identifies 'disable stream x'
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21083 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/demux_ts.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/libmpdemux/demux_ts.c b/libmpdemux/demux_ts.c index 54812d7f15..879dc429ae 100644 --- a/libmpdemux/demux_ts.c +++ b/libmpdemux/demux_ts.c @@ -3189,13 +3189,20 @@ static int demux_ts_control(demuxer_t *demuxer, int cmd, void *arg) { case DEMUXER_CTRL_SWITCH_AUDIO: { - sh_audio_t *sh_audio = demuxer->audio->sh; sh_audio_t *sh_a = NULL; int i, n; - if(!sh_audio) - return DEMUXER_CTRL_NOTIMPL; n = *((int*)arg); + if(n == -2) + { + reset_fifos(priv, 1, 0, 0); + demuxer->audio->id = -2; + demuxer->audio->sh = NULL; + ds_free_packs(demuxer->audio); + *((int*)arg) = demuxer->audio->id; + return DEMUXER_CTRL_OK; + } + if(n < 0) { for(i = 0; i < 8192; i++) @@ -3243,13 +3250,20 @@ static int demux_ts_control(demuxer_t *demuxer, int cmd, void *arg) case DEMUXER_CTRL_SWITCH_VIDEO: { - sh_video_t *sh_video = demuxer->video->sh; sh_video_t *sh_v = NULL; int i, n; - if(!sh_video) - return DEMUXER_CTRL_NOTIMPL; n = *((int*)arg); + if(n == -2) + { + reset_fifos(priv, 0, 1, 0); + demuxer->video->id = -2; + demuxer->video->sh = NULL; + ds_free_packs(demuxer->video); + *((int*)arg) = demuxer->video->id; + return DEMUXER_CTRL_OK; + } + if(n < 0) { for(i = 0; i < 8192; i++) |