[MPlayer-dev-eng] Re: [PATCH] disappearing subtitles at dvd chapter intervals
Tobias Diedrich
ranma at gmx.at
Thu Aug 7 16:28:06 CEST 2003
/me wrote:
> The problem is that mplayer.c calls spudec_assemble with timestamp as
> pts100 value. Timestamp can go backwards, which is not good.
> Using 90000*sh_video->timer instead should fix it AFAICS and is already
> used for spudec_heartbeat.
And Timestamp goes backwards because dvdsub->pts resets before
sh_video->pts, so d_dvdsub->pts - sh_video->pts is negative for a short
time.
Maybe if (fabs(d_dvdsub->pts - sh_video_pts) < THRESHOLD) use
timestamp = 90000*(sh_video->timer + d_dvdsub->pts + sub_delay -
sh_video->pts);
else use
timestamp = 90000*(sh_video->timer + sub_delay);
?
In this case the difference is 447 at the problematic point.
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.708
diff -u -r1.708 mplayer.c
--- mplayer.c 22 Jul 2003 10:46:22 -0000 1.708
+++ mplayer.c 7 Aug 2003 13:32:45 -0000
@@ -3452,7 +3452,9 @@
// DVD sub
len = ds_get_packet_sub(d_dvdsub,(unsigned char**)&packet);
if(len > 0) {
- timestamp = 90000*(sh_video->timer + d_dvdsub->pts + sub_delay - sh_video->pts);
+ if (fabs(d_dvdsub->pts - sh_video->pts) < 10)
+ timestamp = 90000*(sh_video->timer + d_dvdsub->pts + sub_delay - sh_video->pts);
+ else timestamp = 90000*(sh_video->timer + sub_delay);
mp_dbg(MSGT_CPLAYER,MSGL_V,"\rDVD sub: len=%d v_pts=%5.3f s_pts=%5.3f ts=%d \n",len,sh_video->pts,d_dvdsub->pts,timestamp);
}
}
--
Tobias PGP: http://9ac7e0bc.2ya.com
This mail is made of 100% recycled bits
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20030807/51904323/attachment.pgp>
More information about the MPlayer-dev-eng
mailing list