From 2c712a6cfb15ed667979fd6d9cefc2fca0bb5a81 Mon Sep 17 00:00:00 2001 From: dynaflash Date: Mon, 15 Jun 2009 16:39:54 +0000 Subject: [PATCH] MacGui: Fix subtitle issues - fix crash if only closed captions are selected (thanks van). - set RENDERSUB when burned is selected for foreign audio search (thanks j45) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2536 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- macosx/Controller.mm | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/macosx/Controller.mm b/macosx/Controller.mm index da04ca25a..25fe20c56 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -2836,12 +2836,6 @@ bool one_burned = FALSE; */ if (subtitle > 0) { - hb_subtitle_t * subt; - hb_subtitle_config_t sub_config; - - subt = (hb_subtitle_t *)hb_list_item(title->list_subtitle, subtitle); - sub_config = subt->config; - /* if i is 0, then we are in the first item of the subtitles which we need to * check for the "Foreign Audio Search" which would be subtitleSourceTrackNum of 1 * bearing in mind that for all tracks subtitleSourceTrackNum of 0 is None. @@ -2892,14 +2886,14 @@ bool one_burned = FALSE; /* We are setting a source subtitle so access the source subtitle info */ hb_subtitle_t * subt; - hb_subtitle_config_t sub_config; subt = (hb_subtitle_t *)hb_list_item(title->list_subtitle, subtitle); - sub_config = subt->config; if (subt != NULL) { [self writeToActivityLog: "Setting Subtitle: %s", subt]; + + hb_subtitle_config_t sub_config = subt->config; if (!burned && job->mux == HB_MUX_MKV && subt->format == hb_subtitle_s::PICTURESUB) @@ -3359,12 +3353,6 @@ bool one_burned = FALSE; */ if (subtitle > 0) { - hb_subtitle_t * subt; - hb_subtitle_config_t sub_config; - - subt = (hb_subtitle_t *)hb_list_item(title->list_subtitle, subtitle); - sub_config = subt->config; - /* if i is 0, then we are in the first item of the subtitles which we need to * check for the "Foreign Audio Search" which would be subtitleSourceTrackNum of 1 * bearing in mind that for all tracks subtitleSourceTrackNum of 0 is None. @@ -3382,6 +3370,10 @@ bool one_burned = FALSE; { job->select_subtitle_config.dest = hb_subtitle_config_s::PASSTHRUSUB; } + else + { + job->select_subtitle_config.dest = hb_subtitle_config_s::RENDERSUB; + } job->select_subtitle_config.force = force; job->select_subtitle_config.default_track = def; @@ -3410,14 +3402,14 @@ bool one_burned = FALSE; /* We are setting a source subtitle so access the source subtitle info */ hb_subtitle_t * subt; - hb_subtitle_config_t sub_config; subt = (hb_subtitle_t *)hb_list_item(title->list_subtitle, subtitle); - sub_config = subt->config; if (subt != NULL) { [self writeToActivityLog: "Setting Subtitle: %s", subt]; + + hb_subtitle_config_t sub_config = subt->config; if (!burned && job->mux == HB_MUX_MKV && subt->format == hb_subtitle_s::PICTURESUB) -- 2.40.0