[MPlayer-dev-eng] subtitle partially broken with vob/dvd

Jean-Yves Simon lethalwp at tiscali.be
Fri Feb 6 02:37:46 CET 2004


Hello,

Fact: a SPU packet can be split in 2 chunks, first one having a pts,
second none, Most code out there require the same pts on the sub to
merge the packets together

Problem: i've seen on plenty dvds where there are, sometimes, between
those chunks, video chunks. So using the video_pts to know when to
display subs is wrong, that gives a (slight) sub desynch, but can break
some subs too

This problem appears in mplayer.c on line ~3641
        float x = d_dvdsub->pts - sh_video->pts;
        if (x < -10 || x > 10) // prevent missing subs on pts reset
          timestamp = 90000*(sh_video->timer + d_dvdsub->pts + sub_delay
- sh_video->pts);
        else timestamp = 90000*(sh_video->timer + sub_delay);


The problem is that sh_video->timer appears to be zero'ed at each seek,
so i need to know the accurate offset (sh_video->timer <->
d_dvdsub->pts) to get a correct timestamp.  
Yes, getting it with "d_dvdsub->pts - sh_video->pts" seems to work, but
the resulting timestamp still isn't 100% the same, so i suppose there
can be cases where it fail, maybe even where the subschunks are
following each other!?

Anyway, it worked on the vob samples i had here


PS: i know this will render the "if else" statement useless, but i
really don't consider this a good fix :(



-- 
Jean-Yves Simon <lethalwp at tiscali.be>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer.c.subtitle.patch
Type: text/x-patch
Size: 767 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20040206/e042a578/attachment.bin>


More information about the MPlayer-dev-eng mailing list