diff options
author | henry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-04-07 16:04:02 +0000 |
---|---|---|
committer | henry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-04-07 16:04:02 +0000 |
commit | 3f4505eabb260dca3cc0714d36f9c76632821771 (patch) | |
tree | 745dd9cb07e48e80849e6825463639bdc3f02470 /mencoder.c | |
parent | bc745edb16dfcea782082205fba3ca854c6bd0c9 (diff) | |
download | mpv-3f4505eabb260dca3cc0714d36f9c76632821771.tar.bz2 mpv-3f4505eabb260dca3cc0714d36f9c76632821771.tar.xz |
support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9871 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mencoder.c')
-rw-r--r-- | mencoder.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/mencoder.c b/mencoder.c index 5965e21635..49776c1485 100644 --- a/mencoder.c +++ b/mencoder.c @@ -100,7 +100,7 @@ int video_id=-1; int dvdsub_id=-1; int vobsub_id=-1; static char* audio_lang=NULL; -static char* dvdsub_lang=NULL; +char* dvdsub_lang=NULL; static char* spudec_ifo=NULL; static char** audio_codec_list=NULL; // override audio codec @@ -163,7 +163,7 @@ static int play_n_frames_mf=-1; // sub: char *font_name=NULL; float font_factor=0.75; -char *sub_name=NULL; +char **sub_name=NULL; float sub_delay=0; float sub_fps=0; int sub_auto = 0; @@ -171,7 +171,7 @@ int subcc_enabled=0; int suboverlap_enabled = 1; #ifdef USE_SUB -static subtitle* subtitles=NULL; +static sub_data* subdata=NULL; float sub_last_pts = -303; #endif @@ -588,12 +588,12 @@ vo_spudec=spudec_new_scaled(stream->type==STREAMTYPE_DVD?((dvd_priv_t *)(stream- // we know fps so now we can adjust subtitles time to ~6 seconds AST // check .sub // current_module="read_subtitles_file"; - if(sub_name){ - subtitles=sub_read_file(sub_name, sh_video->fps); - if(!subtitles) mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadSub,sub_name); + if(sub_name && sub_name[0]){ + subdata=sub_read_file(sub_name[0], sh_video->fps); + if(!subdata) mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadSub,sub_name[0]); } else if(sub_auto) { // auto load sub file ... - subtitles=sub_read_file( filename ? sub_filename( get_path("sub/"), filename ) + subdata=sub_read_file( filename ? sub_filenames( get_path("sub/"), filename )[0] : "default.sub", sh_video->fps ); } #endif @@ -1226,11 +1226,13 @@ if(sh_audio && !demuxer2){ #ifdef USE_SUB // find sub - if(subtitles && sh_video->pts>0){ + if(subdata && sh_video->pts>0){ float pts=sh_video->pts; if(sub_fps==0) sub_fps=sh_video->fps; if (pts > sub_last_pts || pts < sub_last_pts-1.0 ) { - find_sub(subtitles,sub_uses_time?(100*(pts+sub_delay)):((pts+sub_delay)*sub_fps)); // FIXME! frame counter... + find_sub(subdata, (pts+sub_delay) * + (subdata->sub_uses_time? 100. : sub_fps)); + // FIXME! frame counter... sub_last_pts = pts; } } |