mirror of https://github.com/mpv-player/mpv
some small sub bug fix
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3544 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
c8edb9e918
commit
cf33c343cf
|
@ -25,6 +25,9 @@ static int nosub_range_end=-1;
|
|||
|
||||
void find_sub(subtitle* subtitles,int key){
|
||||
int i,j;
|
||||
|
||||
if ( !subtitles ) return;
|
||||
|
||||
if(vo_sub){
|
||||
if(key>=vo_sub->start && key<=vo_sub->end) return; // OK!
|
||||
} else {
|
||||
|
|
24
mplayer.c
24
mplayer.c
|
@ -663,13 +663,17 @@ play_next_file:
|
|||
usleep(20000);
|
||||
EventHandling();
|
||||
}
|
||||
if(mplShMem->FilenameChanged){
|
||||
filename=mplShMem->Filename;
|
||||
}
|
||||
|
||||
#ifdef USE_SUB
|
||||
sub_name=NULL;
|
||||
if ( mplShMem->SubtitleChanged ) sub_name=mplShMem->Subtitlename;
|
||||
if ( mplShMem->SubtitleChanged || !mplShMem->FilenameChanged )
|
||||
{ sub_name=mplShMem->Subtitlename; mplShMem->SubtitleChanged=0; }
|
||||
#endif
|
||||
|
||||
if ( mplShMem->FilenameChanged || !filename )
|
||||
{
|
||||
filename=mplShMem->Filename;
|
||||
mplShMem->FilenameChanged=0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -2178,7 +2182,15 @@ if(use_gui || ++curr_filename<num_filenames){
|
|||
|
||||
current_module="free_stream";
|
||||
if(stream) free_stream(stream);
|
||||
|
||||
|
||||
current_module="sub_free";
|
||||
if ( subtitles )
|
||||
{
|
||||
sub_free( subtitles );
|
||||
sub_name=NULL;
|
||||
vo_sub=NULL;
|
||||
}
|
||||
|
||||
video_out=NULL;
|
||||
audio_out=NULL;
|
||||
|
||||
|
|
13
subreader.c
13
subreader.c
|
@ -802,7 +802,18 @@ void dump_mpsub(subtitle* subs){
|
|||
printf ("Subtitles dumped in \'dump.mpsub\'.\n");
|
||||
}
|
||||
|
||||
|
||||
void sub_free( subtitle * subs )
|
||||
{
|
||||
int i;
|
||||
|
||||
if ( !subs ) return;
|
||||
|
||||
sub_num=0;
|
||||
sub_errs=0;
|
||||
for ( i=0;i<subs->lines;i++ ) free( subs->text[i] );
|
||||
free( subs );
|
||||
subs=NULL;
|
||||
}
|
||||
|
||||
#ifdef DUMPSUBS
|
||||
int main(int argc, char **argv) { // for testing
|
||||
|
|
|
@ -37,5 +37,6 @@ typedef struct {
|
|||
subtitle* sub_read_file (char *filename);
|
||||
char * sub_filename(char *path, char * fname );
|
||||
void list_sub_file(subtitle* subs);
|
||||
void sub_free( subtitle * subs );
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue