[MPlayer-cvslog] r24857 - trunk/find_sub.c

ulion subversion at mplayerhq.hu
Sat Oct 27 02:37:47 CEST 2007


Author: ulion
Date: Sat Oct 27 02:37:46 2007
New Revision: 24857

Log:
Reset two static variables for nosub range when subdata changed/switched.
This fix some subtitle disappear bug when switch between subtitle streams.


Modified:
   trunk/find_sub.c

Modified: trunk/find_sub.c
==============================================================================
--- trunk/find_sub.c	(original)
+++ trunk/find_sub.c	Sat Oct 27 02:37:46 2007
@@ -18,6 +18,7 @@ static int current_sub=0;
 //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 @@ void find_sub(sub_data* subd,int key){
     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 {



More information about the MPlayer-cvslog mailing list