mirror of https://github.com/mpv-player/mpv
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
This commit is contained in:
parent
85b15648f9
commit
354538912c
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue