diff options
author | Rodeo <[email protected]> | 2014-02-13 15:18:15 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2014-02-13 15:18:15 +0000 |
commit | 1a1b1591ef5acd8495dc8e736a47852e93694020 (patch) | |
tree | 7c9cd72eff31ee912ad12fa8c6f16b7d01e40a7a /macosx/HBPreviewGenerator.m | |
parent | 94d470181e290d89f3be93cd13c28f415dd00ab7 (diff) |
libhb: make encoder options less x264-centric.
profile/level control and, to a lesser extent,
encoder presets and tunes are becoming more common.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6031 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBPreviewGenerator.m')
-rw-r--r-- | macosx/HBPreviewGenerator.m | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/macosx/HBPreviewGenerator.m b/macosx/HBPreviewGenerator.m index 25a7ec344..45c4571a0 100644 --- a/macosx/HBPreviewGenerator.m +++ b/macosx/HBPreviewGenerator.m @@ -254,21 +254,40 @@ typedef enum EncodeState : NSUInteger { int loggingLevel = [[[NSUserDefaults standardUserDefaults] objectForKey:@"LoggingLevel"] intValue]; self.privateHandle = hb_init(loggingLevel, 0); - /* If scanning we need to do some extra setup of the job. */ + /* + * If scanning we need to do some extra setup of the job. + */ if (job->indepth_scan == 1) { - char *x264opts_tmp; - /* When subtitle scan is enabled do a fast pre-scan job - * which will determine which subtitles to enable, if any. */ + char *encoder_preset_tmp = job->encoder_preset != NULL ? strdup(job->encoder_preset) : NULL; + char *encoder_tune_tmp = job->encoder_tune != NULL ? strdup(job->encoder_tune) : NULL; + char *encoder_options_tmp = job->encoder_options != NULL ? strdup(job->encoder_options) : NULL; + char *encoder_profile_tmp = job->encoder_profile != NULL ? strdup(job->encoder_profile) : NULL; + char *encoder_level_tmp = job->encoder_level != NULL ? strdup(job->encoder_level) : NULL; + /* + * When subtitle scan is enabled do a fast pre-scan job + * which will determine which subtitles to enable, if any. + */ + hb_job_set_encoder_preset (job, NULL); + hb_job_set_encoder_tune (job, NULL); + hb_job_set_encoder_options(job, NULL); + hb_job_set_encoder_profile(job, NULL); + hb_job_set_encoder_level (job, NULL); job->pass = -1; - x264opts_tmp = job->advanced_opts; - - job->advanced_opts = NULL; - job->indepth_scan = 1; - - /* Add the pre-scan job */ hb_add(self.privateHandle, job); - job->advanced_opts = x264opts_tmp; + /* + * reset the advanced settings + */ + hb_job_set_encoder_preset (job, encoder_preset_tmp); + hb_job_set_encoder_tune (job, encoder_tune_tmp); + hb_job_set_encoder_options(job, encoder_options_tmp); + hb_job_set_encoder_profile(job, encoder_profile_tmp); + hb_job_set_encoder_level (job, encoder_level_tmp); + free(encoder_preset_tmp); + free(encoder_tune_tmp); + free(encoder_options_tmp); + free(encoder_profile_tmp); + free(encoder_level_tmp); } /* Go ahead and perform the actual encoding preview scan */ |