# HG changeset patch # User ulion # Date 1193445466 0 # Node ID 8f846cea9940b30af276d16aa01e0b2fe9c5b9eb # Parent 810982c2bfb43057b882c84e9347144b678a441b Reset two static variables for nosub range when subdata changed/switched. This fix some subtitle disappear bug when switch between subtitle streams. diff -r 810982c2bfb4 -r 8f846cea9940 find_sub.c --- 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 {