diff options
author | ritsuka <[email protected]> | 2015-01-31 17:07:18 +0000 |
---|---|---|
committer | ritsuka <[email protected]> | 2015-01-31 17:07:18 +0000 |
commit | f4fae8fcc8a58329717b6375c6a142675dacac9b (patch) | |
tree | a6d7decdd2b033b2d004a6482db4350e2871e5f7 /macosx/HBJob+HBJobConversion.m | |
parent | 6d57e42b6b2cc38cf256f2970b23b94121e49479 (diff) |
MacGui: fix an issue where a "none" track could be added to hb_job_t.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6841 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBJob+HBJobConversion.m')
-rw-r--r-- | macosx/HBJob+HBJobConversion.m | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/macosx/HBJob+HBJobConversion.m b/macosx/HBJob+HBJobConversion.m index 314c320b2..65e25fe8b 100644 --- a/macosx/HBJob+HBJobConversion.m +++ b/macosx/HBJob+HBJobConversion.m @@ -217,26 +217,21 @@ // Map the settings in the dictionaries for the SubtitleList array to match title->list_subtitle BOOL one_burned = NO; - int i = 0; - for (NSDictionary *subtitleDict in self.subtitles.tracks) { + int subtitle = [subtitleDict[keySubTrackIndex] intValue]; + BOOL force = [subtitleDict[keySubTrackForced] boolValue]; + BOOL burned = [subtitleDict[keySubTrackBurned] boolValue]; + BOOL def = [subtitleDict[keySubTrackDefault] boolValue]; + // Skip the "None" track. - if (i == self.subtitles.tracks.count - 1) + if (subtitle == -2) { continue; } - int subtitle = [subtitleDict[keySubTrackIndex] intValue]; - int force = [subtitleDict[keySubTrackForced] intValue]; - int burned = [subtitleDict[keySubTrackBurned] intValue]; - int def = [subtitleDict[keySubTrackDefault] intValue]; - - // 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 keySubTrackIndex of -1 - - // if we are on the first track and using "Foreign Audio Search" - if (i == 0 && subtitle == -1) + // we need to check for the "Foreign Audio Search" which would be keySubTrackIndex of -1 + if (subtitle == -1) { job->indepth_scan = 1; @@ -261,7 +256,7 @@ sub_config.offset = [subtitleDict[keySubTrackSrtOffset] intValue]; - // we need to srncpy file name and codeset + // we need to strncpy file name and codeset strncpy(sub_config.src_filename, [subtitleDict[keySubTrackSrtFilePath] UTF8String], 255); sub_config.src_filename[255] = 0; strncpy(sub_config.src_codeset, [subtitleDict[keySubTrackSrtCharCode] UTF8String], 39); @@ -276,7 +271,7 @@ // Only allow one subtitle to be burned into the video if (one_burned) continue; - one_burned = TRUE; + one_burned = YES; sub_config.dest = RENDERSUB; } @@ -302,7 +297,7 @@ // Only allow one subtitle to be burned into the video if (one_burned) continue; - one_burned = TRUE; + one_burned = YES; sub_config.dest = RENDERSUB; } @@ -311,7 +306,6 @@ hb_subtitle_add(job, &sub_config, subtitle); } } - i++; } if (one_burned) |