summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorranma <ranma@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-08-10 17:58:22 +0000
committerranma <ranma@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-08-10 17:58:22 +0000
commit3142d28ed1241db2d55e19f391ed8a02cb9a0f15 (patch)
treebfebe60f1bcb512ebbd7911e40b423ac4ab90f20 /mplayer.c
parent738e1b801f256273affc129c34885e30ba039bcb (diff)
downloadmpv-3142d28ed1241db2d55e19f391ed8a02cb9a0f15.tar.bz2
mpv-3142d28ed1241db2d55e19f391ed8a02cb9a0f15.tar.xz
Prevent missing subtitles at pts reset.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10558 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mplayer.c b/mplayer.c
index 650c4d0b32..659569e626 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -3460,7 +3460,9 @@ if(vo_config_count && vo_spudec) {
// 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) // 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);
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);
}
}