[MPlayer-dev-eng] Re:[PATCH] Skipped subtitles in first part of DVD

Olaf Mandel olaf at mandel.name
Sun Oct 1 09:18:36 CEST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

let me try again, this time with the patch actually part of the mail body...

>
> if a DVD (or any MPEG?) is played back with subtitles, it can happen that
> several of the first subtitles are not displayed. In mplayer this can be
> corrected by seeking in the movie, but there is no workaround for
> mencoder.
>
> The problem is in the MPEG-demuxer in demux_mpg_open(), where repeated
> calls to ds_fill_buffer(demuxer->video) not only fill the video stream,
> but sometimes also the subtitle stream. These packets need to be removed
> from the stream, otherwise all subtitles before the one from the forgotten
> packet are dropped.
>
> Something similar seems to happen in demux_seek_mpg(), but I have not seen
> that bug and cannot say if the second added line in the patch is needed or
> not. Could someone who knows the demuxer please look at it?
>
> Thanks,
> Olaf Mandel
- --
Olaf Mandel              eMail Olaf at Mandel.name

Index: libmpdemux/demux_mpg.c
===================================================================
- --- libmpdemux/demux_mpg.c      (revision 20009)
+++ libmpdemux/demux_mpg.c      (working copy)
@@ -135,6 +135,7 @@
     if (mpg_d->final_pts > 3 * half_pts || mpg_d->final_pts < 1.5 *
half_pts) {       mpg_d->has_valid_timestamps = 0;
     }
+    ds_free_packs(demuxer->sub);
     ds_free_packs(demuxer->audio);
     ds_free_packs(demuxer->video);
     demuxer->stream->eof=0; // clear eof flag
@@ -789,6 +790,7 @@
         //prepare another seek because we are off by more than 0.5s
        if(mpg_d) {
         newpos += (newpts - mpg_d->last_pts) * (newpos - oldpos) /
(mpg_d->last_pts - oldpts);
+        ds_free_packs(demuxer->sub);  //Unsure: is this necessary?
         ds_free_packs(d_audio);
         ds_free_packs(d_video);
         demuxer->stream->eof=0; // clear eof flag


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFFH2vMmafSxjM5iEgRAuSDAJ48NYJ527vxTXeSBkojuDeIqont0gCgr3wz
frfl8dtDXC09i8gSBhO5TaY=
=w5dE
-----END PGP SIGNATURE-----




More information about the MPlayer-dev-eng mailing list