[MPlayer-cvslog] r33476 - trunk/sub/find_sub.c

iive subversion at mplayerhq.hu
Sat May 21 16:26:28 CEST 2011


Author: iive
Date: Sat May 21 16:26:27 2011
New Revision: 33476

Log:
Fix stepping forward/backward in subtitle list after commit r31663.

The sub_delay polarity have been changed in r31663, but the calculation
of the timestamps in step_sub() haven't been changed to reflect it.
As result stepping seemed to have some effect, but the subtitles
seemed to oscillate in strange patterns.

Fixes bug 1858.

Modified:
   trunk/sub/find_sub.c

Modified: trunk/sub/find_sub.c
==============================================================================
--- trunk/sub/find_sub.c	Sat May 21 11:12:16 2011	(r33475)
+++ trunk/sub/find_sub.c	Sat May 21 16:26:27 2011	(r33476)
@@ -44,7 +44,7 @@ void step_sub(sub_data *subd, float pts,
 
     if (subd == NULL) return;
     subs = subd->subtitles;
-    key = (pts+sub_delay) * (subd->sub_uses_time ? 100 : sub_fps);
+    key = (pts-sub_delay) * (subd->sub_uses_time ? 100 : sub_fps);
 
     /* Tell the OSD subsystem that the OSD contents will change soon */
     vo_osd_changed(OSDTYPE_SUBTITLE);
@@ -64,7 +64,7 @@ void step_sub(sub_data *subd, float pts,
     	movement = subd->sub_num - current_sub - 1;
 
     current_sub += movement;
-    sub_delay = subs[current_sub].start / (subd->sub_uses_time ? 100 : sub_fps) - pts;
+    sub_delay = pts - subs[current_sub].start / (subd->sub_uses_time ? 100 : sub_fps);
 }
 
 void find_sub(sub_data* subd,int key){


More information about the MPlayer-cvslog mailing list