changeset 33388:25880d57740d

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.
author iive
date Sat, 21 May 2011 14:26:27 +0000
parents 1aac4a6026fa
children 2672587086ad
files sub/find_sub.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/sub/find_sub.c	Sat May 21 09:12:16 2011 +0000
+++ b/sub/find_sub.c	Sat May 21 14:26:27 2011 +0000
@@ -44,7 +44,7 @@
 
     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 @@
     	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){