diff options
author | Rodeo <[email protected]> | 2012-07-29 14:16:28 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2012-07-29 14:16:28 +0000 |
commit | d3593cb63f7a6c8602faae00f04da378f060fb4c (patch) | |
tree | d5ab5058a5f4283271a8da3c4269704184a7155e | |
parent | 93dee4d1960fa54a3c08d889f31cd56db1dfbb49 (diff) |
Use HB_INVALID_AMIXDOWN and HB_AMIXDOWN_NONE where applicable.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4879 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | gtk/src/hb-backend.c | 4 | ||||
-rw-r--r-- | libhb/common.c | 6 | ||||
-rw-r--r-- | libhb/work.c | 9 | ||||
-rw-r--r-- | macosx/HBAudio.m | 2 |
4 files changed, 11 insertions, 10 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index a4d5ee040..f5746e9f9 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -1683,7 +1683,7 @@ ghb_grey_combo_options(signal_user_data_t *ud) fallback = ghb_settings_combo_int(ud->settings, "AudioEncoderFallback"); gint copy_mask = ghb_get_copy_mask(ud->settings); acodec = ghb_select_audio_codec(mux, aconfig, acodec, fallback, copy_mask); - gint best = hb_get_best_mixdown(acodec, aconfig->in.channel_layout, 0); + gint best = hb_get_best_mixdown(acodec, aconfig->in.channel_layout, HB_INVALID_AMIXDOWN); allow_stereo = best >= HB_AMIXDOWN_STEREO; allow_dolby = best >= HB_AMIXDOWN_DOLBY; @@ -4479,7 +4479,7 @@ ghb_validate_audio(GValue *settings) gboolean allow_6ch = TRUE; allow_mono = TRUE; - gint best = hb_get_best_mixdown(codec, aconfig->in.channel_layout, 0); + gint best = hb_get_best_mixdown(codec, aconfig->in.channel_layout, HB_INVALID_AMIXDOWN); allow_stereo = best >= HB_AMIXDOWN_STEREO; allow_dolby = best >= HB_AMIXDOWN_DOLBY; diff --git a/libhb/common.c b/libhb/common.c index f1a94267c..13a2e1d95 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -761,8 +761,8 @@ int hb_get_best_mixdown(uint32_t codec, uint64_t layout, int mixdown) } // return the best that is not greater than the requested mixdown - // 0 means the caller requested the best available mixdown - if (best_mixdown > mixdown && mixdown > 0) + // HB_INVALID_AMIXDOWN means the caller requested the best available mixdown + if (best_mixdown > mixdown && mixdown != HB_INVALID_AMIXDOWN) best_mixdown = mixdown; return best_mixdown; @@ -1681,7 +1681,7 @@ int hb_audio_add(const hb_job_t * job, const hb_audio_config_t * audiocfg) /* Pass-through, copy from input. */ audio->config.out.samplerate = audio->config.in.samplerate; audio->config.out.bitrate = audio->config.in.bitrate; - audio->config.out.mixdown = 0; + audio->config.out.mixdown = HB_AMIXDOWN_NONE; audio->config.out.dynamic_range_compression = 0; audio->config.out.gain = 0; audio->config.out.compression_level = -1; diff --git a/libhb/work.c b/libhb/work.c index ae7538dfd..6e49687da 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -817,7 +817,7 @@ static void do_job( hb_job_t * job ) audio = hb_list_item( title->list_audio, i ); /* sense-check the requested mixdown */ - if( audio->config.out.mixdown <= 0 && + if( audio->config.out.mixdown <= HB_AMIXDOWN_NONE && !( audio->config.out.codec & HB_ACODEC_PASS_FLAG ) ) { /* @@ -845,10 +845,11 @@ static void do_job( hb_job_t * job ) } } - best_mixdown = hb_get_best_mixdown( audio->config.out.codec, - audio->config.in.channel_layout, 0 ); + best_mixdown = hb_get_best_mixdown(audio->config.out.codec, + audio->config.in.channel_layout, + audio->config.out.mixdown); - if ( audio->config.out.mixdown > best_mixdown ) + if (audio->config.out.mixdown != best_mixdown) { audio->config.out.mixdown = best_mixdown; } diff --git a/macosx/HBAudio.m b/macosx/HBAudio.m index b170e4a50..8a5f06291 100644 --- a/macosx/HBAudio.m +++ b/macosx/HBAudio.m @@ -231,7 +231,7 @@ static NSMutableArray *masterBitRateArray = nil; unsigned int count = [masterMixdownArray count]; int codecCodec = [[codec objectForKey: keyAudioCodec] intValue]; int theDefaultMixdown = hb_get_default_mixdown(codecCodec, channelLayout); - int theBestMixdown = hb_get_best_mixdown(codecCodec, channelLayout, 0); + int theBestMixdown = hb_get_best_mixdown(codecCodec, channelLayout, HB_INVALID_AMIXDOWN); for (unsigned int i = 0; i < count; i++) { |