aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--libmpdemux/demuxer.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c
index 20a1fc44ed..857232abdd 100644
--- a/libmpdemux/demuxer.c
+++ b/libmpdemux/demuxer.c
@@ -1142,6 +1142,10 @@ int demuxer_switch_audio(demuxer_t *demuxer, int index){
int res = demux_control(demuxer, DEMUXER_CTRL_SWITCH_AUDIO, &index);
if (res == DEMUXER_CTRL_NOTIMPL)
index = demuxer->audio->id;
+ if (demuxer->audio->id >= 0)
+ demuxer->audio->sh = demuxer->a_streams[demuxer->audio->id];
+ else
+ demuxer->audio->sh = NULL;
return index;
}
@@ -1149,6 +1153,10 @@ 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;
+ if (demuxer->video->id >= 0)
+ demuxer->video->sh = demuxer->v_streams[demuxer->video->id];
+ else
+ demuxer->video->sh = NULL;
return index;
}