diff options
author | jstebbins <[email protected]> | 2009-06-02 15:32:01 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2009-06-02 15:32:01 +0000 |
commit | b1fcb3154f5c09a81e0cf712fad9d22f4e8e89bc (patch) | |
tree | 263ef770c5316bd112024f2a688c272c69f5b528 /libhb/hb.c | |
parent | 8868e9649a2ff1c60a3334e00418bba92eb67f70 (diff) |
softsubtitles:
- when doing an indepth scan, do not scan CC tracks
- separate subtitle configureation attributes into separate
hb_subtitle_config_t. Add an instance of this to hb_job_t for
setting the attributes of the subtitle found through an indepth scan
- Add a default_track flag to hb_subtitle_config_t that tells the muxer
that the track should be flaged as the default. muxmkv uses this.
- When an indepth scan is complete, check to see if the autoselected
subtitle matchces (by id) one of the manually selected subtitles.
If a match is found, the autoselected subtitle with all the attributes
the user assigned to it replaces the manually selected subtitle.
- LinGui: Add "Default" column to subtitle tab. This is a radio that lets
the user choose which subtitle should be displayed by default.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2468 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/hb.c')
-rw-r--r-- | libhb/hb.c | 66 |
1 files changed, 28 insertions, 38 deletions
diff --git a/libhb/hb.c b/libhb/hb.c index c4045170c..9fdfe90f4 100644 --- a/libhb/hb.c +++ b/libhb/hb.c @@ -1066,7 +1066,8 @@ void hb_add( hb_handle_t * h, hb_job_t * job ) for( i=0; i < hb_list_count( title->list_subtitle ); i++ ) { subtitle = hb_list_item( title->list_subtitle, i ); - if( strcmp( subtitle->iso639_2, audio_lang ) == 0 ) + if( strcmp( subtitle->iso639_2, audio_lang ) == 0 && + subtitle->source == VOBSUB ) { /* * Matched subtitle language with audio language, so @@ -1093,56 +1094,45 @@ void hb_add( hb_handle_t * h, hb_job_t * job ) * Not doing a subtitle scan in this pass, but maybe we are in the * first pass? */ - if( job->select_subtitle ) + if( job->pass != 1 && job->native_language ) { /* - * Don't add subtitles here, we'll add them via select_subtitle - * at the end of the subtitle_scan. + * We are not doing a subtitle scan but do want the + * native langauge subtitle selected, so select it + * for pass 0 or pass 2 of a two pass. */ + for( i=0; i < hb_list_count( title->list_subtitle ); i++ ) + { + subtitle = hb_list_item( title->list_subtitle, i ); + if( strcmp( subtitle->iso639_2, audio_lang ) == 0 ) + { + /* + * Matched subtitle language with audio language, so + * add this to our list to scan. + */ + subtitle_copy = malloc( sizeof( hb_subtitle_t ) ); + memcpy( subtitle_copy, subtitle, sizeof( hb_subtitle_t ) ); + hb_list_add( title_copy->list_subtitle, subtitle_copy ); + break; + } + } } else { /* - * Definitely not doing a subtitle scan. + * Manually selected subtitles, in which case only + * bother adding them for pass 0 or pass 2 of a two + * pass. */ - if( job->pass != 1 && job->native_language ) + if( job->pass != 1 ) { /* - * We are not doing a subtitle scan but do want the - * native langauge subtitle selected, so select it - * for pass 0 or pass 2 of a two pass. + * Copy all of them from the input job, to the title_copy/job_copy. */ - for( i=0; i < hb_list_count( title->list_subtitle ); i++ ) - { - subtitle = hb_list_item( title->list_subtitle, i ); - if( strcmp( subtitle->iso639_2, audio_lang ) == 0 ) + for( i = 0; i < hb_list_count(job->list_subtitle); i++ ) { + if( ( subtitle = hb_list_item( job->list_subtitle, i ) ) ) { - /* - * Matched subtitle language with audio language, so - * add this to our list to scan. - */ subtitle_copy = malloc( sizeof( hb_subtitle_t ) ); memcpy( subtitle_copy, subtitle, sizeof( hb_subtitle_t ) ); hb_list_add( title_copy->list_subtitle, subtitle_copy ); - break; - } - } - } else { - /* - * Manually selected subtitles, in which case only - * bother adding them for pass 0 or pass 2 of a two - * pass. - */ - if( job->pass != 1 ) - { - /* - * Copy all of them from the input job, to the title_copy/job_copy. - */ - for( i = 0; i < hb_list_count(job->list_subtitle); i++ ) { - if( ( subtitle = hb_list_item( job->list_subtitle, i ) ) ) - { - subtitle_copy = malloc( sizeof( hb_subtitle_t ) ); - memcpy( subtitle_copy, subtitle, sizeof( hb_subtitle_t ) ); - hb_list_add( title_copy->list_subtitle, subtitle_copy ); - } } } } |