From 354538912cd5049c843b79d1a20bb3f144c6140a Mon Sep 17 00:00:00 2001 From: ulion Date: Sat, 27 Oct 2007 00:37:46 +0000 Subject: [PATCH] Reset two static variables for nosub range when subdata changed/switched. This fix some subtitle disappear bug when switch between subtitle streams. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24857 b3059339-0415-0410-9bf9-f77b7e298cf2 --- find_sub.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/find_sub.c b/find_sub.c index c6db1e2c51..71841dfa11 100644 --- a/find_sub.c +++ b/find_sub.c @@ -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 {