[MPlayer-cvslog] r26121 - trunk/libmpdemux/demuxer.c

eugeni subversion at mplayerhq.hu
Fri Feb 29 18:25:48 CET 2008


Author: eugeni
Date: Fri Feb 29 18:25:48 2008
New Revision: 26121

Log:
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.


Modified:
   trunk/libmpdemux/demuxer.c

Modified: trunk/libmpdemux/demuxer.c
==============================================================================
--- trunk/libmpdemux/demuxer.c	(original)
+++ trunk/libmpdemux/demuxer.c	Fri Feb 29 18:25:48 2008
@@ -1142,6 +1142,10 @@ int demuxer_switch_audio(demuxer_t *demu
     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 *demu
     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;
 }
 



More information about the MPlayer-cvslog mailing list