diff options
author | eugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-02-29 17:25:48 +0000 |
---|---|---|
committer | eugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-02-29 17:25:48 +0000 |
commit | 377d745ae9816be0fc1f618dc8de7d83235df1c9 (patch) | |
tree | 7fa2d4d7c939890cb00fa42a7b063a75557b2c23 /libmpdemux | |
parent | c85a382afac9598a43c6220fb1801feda5b2d617 (diff) |
Set audio->sh correctly when switching audio tracks. The same for video tracks.
Demuxers almost never update audio->sh or sub->sh when swithing tracks. It is
especially bad when switching to no sound, and results in "too many audio
packets" error.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26121 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/demuxer.c | 8 |
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; } |