From c5cbf5efe60c93bcd82ee5cd4dc8b8008d4d3b53 Mon Sep 17 00:00:00 2001 From: nicodvb Date: Sun, 1 Oct 2006 09:33:23 +0000 Subject: [PATCH] Reset demuxer->sub (consistently with audio and video) after seeking and at the end of demux_mpg_open() to prevent ghost packets. Patch by Olaf Mandel - olaf mandel name. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20011 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_mpg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libmpdemux/demux_mpg.c b/libmpdemux/demux_mpg.c index 773ac44f6a..7bae4f3f74 100644 --- a/libmpdemux/demux_mpg.c +++ b/libmpdemux/demux_mpg.c @@ -137,6 +137,7 @@ static demuxer_t* demux_mpg_open(demuxer_t* demuxer) { } ds_free_packs(demuxer->audio); ds_free_packs(demuxer->video); + ds_free_packs(demuxer->sub); demuxer->stream->eof=0; // clear eof flag demuxer->video->eof=0; demuxer->audio->eof=0; @@ -791,6 +792,7 @@ void demux_seek_mpg(demuxer_t *demuxer,float rel_seek_secs,float audio_delay, in newpos += (newpts - mpg_d->last_pts) * (newpos - oldpos) / (mpg_d->last_pts - oldpts); ds_free_packs(d_audio); ds_free_packs(d_video); + ds_free_packs(demuxer->sub); demuxer->stream->eof=0; // clear eof flag d_video->eof=0; d_audio->eof=0;