summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gtk/src/hb-backend.c4
-rw-r--r--libhb/common.c6
-rw-r--r--libhb/work.c9
-rw-r--r--macosx/HBAudio.m2
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++)
{