changeset 24829:8f846cea9940

Reset two static variables for nosub range when subdata changed/switched. This fix some subtitle disappear bug when switch between subtitle streams.
author ulion
date Sat, 27 Oct 2007 00:37:46 +0000
parents 810982c2bfb4
children 31efcf6a10d0
files find_sub.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/find_sub.c	Thu Oct 25 21:20:28 2007 +0000
+++ b/find_sub.c	Sat Oct 27 00:37:46 2007 +0000
@@ -18,6 +18,7 @@
 //static subtitle* subtitles=NULL;
 static int nosub_range_start=-1;
 static int nosub_range_end=-1;
+static const sub_data *last_sub_data = NULL;
 
 extern float sub_delay;
 extern float  sub_fps;
@@ -58,6 +59,13 @@
     if ( !subd || subd->sub_num == 0) return;
     subs = subd->subtitles;
     
+    if (last_sub_data != subd) {
+        // Sub data changed, reset nosub range.
+        last_sub_data = subd;
+        nosub_range_start = -1;
+        nosub_range_end = -1;
+    }
+
     if(vo_sub){
       if(key>=vo_sub->start && key<=vo_sub->end) return; // OK!
     } else {