changeset 3274:ac7ded58b6df

mpeg subtitle flickering patch by Evgeny Chukreev <codedj@echo.ru>
author arpi
date Mon, 03 Dec 2001 01:03:17 +0000
parents df10916cbd41
children 38344371432f
files mplayer.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mplayer.c	Sun Dec 02 20:36:43 2001 +0000
+++ b/mplayer.c	Mon Dec 03 01:03:17 2001 +0000
@@ -391,6 +391,7 @@
 
 #ifdef USE_SUB
 static subtitle* subtitles=NULL;
+float sub_last_pts = -303;
 #endif
 
 static demuxer_t *demuxer=NULL;
@@ -2068,7 +2069,10 @@
       float pts=d_video->pts;
       if(sub_fps==0) sub_fps=sh_video->fps;
       current_module="find_sub";
-      find_sub(subtitles,sub_uses_time?(100*(pts+sub_delay)):((pts+sub_delay)*sub_fps)); // FIXME! frame counter...
+      if (pts > sub_last_pts || pts < sub_last_pts-1.0 ) {
+         find_sub(subtitles,sub_uses_time?(100*(pts+sub_delay)):((pts+sub_delay)*sub_fps)); // FIXME! frame counter...
+         sub_last_pts = pts;
+      }
       current_module=NULL;
   }
 #endif