diff options
author | ulion <ulion@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-10-27 00:37:46 +0000 |
---|---|---|
committer | ulion <ulion@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-10-27 00:37:46 +0000 |
commit | 354538912cd5049c843b79d1a20bb3f144c6140a (patch) | |
tree | 51e0318f949aa8d748ad2da8cd8fc5f18b1c5260 | |
parent | 85b15648f9eb95f05a5ea7a4dedeec6859191659 (diff) |
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
-rw-r--r-- | find_sub.c | 8 |
1 files changed, 8 insertions, 0 deletions
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 { |