diff options
author | John Stebbins <[email protected]> | 2016-06-10 15:38:44 -0600 |
---|---|---|
committer | John Stebbins <[email protected]> | 2016-06-10 15:40:13 -0600 |
commit | 860d9f92442584796b8a1128c49a4b867ddedfa0 (patch) | |
tree | 1b6df61adc8766a123bc744cf40bb2af158f5783 /libhb/hb.c | |
parent | 4dbd2a33fde3b9c15fb2b0b2195e88bb7ac9ad3e (diff) |
subtitle scan: drop scan pass if there are no suitable subtitles
A suitable subtitle is one that matches the users preferred language.
Diffstat (limited to 'libhb/hb.c')
-rw-r--r-- | libhb/hb.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/libhb/hb.c b/libhb/hb.c index 12e541a92..1850cc1fb 100644 --- a/libhb/hb.c +++ b/libhb/hb.c @@ -1398,8 +1398,21 @@ static void hb_add_internal( hb_handle_t * h, hb_job_t * job, hb_list_t *list_pa char audio_lang[4]; /* Copy the job */ - job_copy = calloc( sizeof( hb_job_t ), 1 ); - memcpy( job_copy, job, sizeof( hb_job_t ) ); + job_copy = calloc( sizeof( hb_job_t ), 1 ); + memcpy(job_copy, job, sizeof(hb_job_t)); + job_copy->json = NULL; + job_copy->encoder_preset = NULL; + job_copy->encoder_tune = NULL; + job_copy->encoder_profile = NULL; + job_copy->encoder_level = NULL; + job_copy->encoder_options = NULL; + job_copy->file = NULL; + job_copy->list_chapter = NULL; + job_copy->list_audio = NULL; + job_copy->list_subtitle = NULL; + job_copy->list_filter = NULL; + job_copy->list_attachment = NULL; + job_copy->metadata = NULL; /* If we're doing Foreign Audio Search, copy all subtitles matching the * first audio track language we find in the audio list. @@ -1444,6 +1457,12 @@ static void hb_add_internal( hb_handle_t * h, hb_job_t * job, hb_list_t *list_pa hb_subtitle_copy( subtitle ) ); } } + if (hb_list_count(job_copy->list_subtitle) == 0) + { + hb_log("Skipping subtitle scan. No suitable subtitle tracks."); + hb_job_close(&job_copy); + return; + } } else { |