]> granicus.if.org Git - handbrake/commitdiff
libhb: fix audio bitrate when using fallback encoder
authorJohn Stebbins <jstebbins.hb@gmail.com>
Thu, 29 Dec 2016 21:18:41 +0000 (14:18 -0700)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Thu, 29 Dec 2016 21:21:32 +0000 (14:21 -0700)
Fixes https://github.com/HandBrake/HandBrake/issues/462

hb_audio_add was overwriting the desired output bitrate before we
discovered that we needed to use the fallback encoder.

(cherry picked from commit 56e26f4b112a8454c09f355ca3eefab52f2b76ed)

libhb/common.c

index 01f0bb2bb709921605925caf674eaff09f8a52fd..18e43b4a1a3f224b83862c7c03ad3b43f37c046b 100644 (file)
@@ -4540,38 +4540,8 @@ int hb_audio_add(const hb_job_t * job, const hb_audio_config_t * audiocfg)
 
     /* Really shouldn't ignore the passed out track, but there is currently no
      * way to handle duplicates or out-of-order track numbers. */
+    audio->config.out = audiocfg->out;
     audio->config.out.track = hb_list_count(job->list_audio) + 1;
-    int codec = audiocfg->out.codec;
-    if(!(codec & HB_ACODEC_PASS_FLAG) ||
-       ((codec & HB_ACODEC_PASS_FLAG) &&
-        !(codec & audio->config.in.codec) &&
-        hb_audio_encoder_is_enabled(codec & ~HB_ACODEC_PASS_FLAG)))
-    {
-        audio->config.out.codec = codec & ~HB_ACODEC_PASS_FLAG;
-        audio->config.out.samplerate = audiocfg->out.samplerate;
-        audio->config.out.bitrate = audiocfg->out.bitrate;
-        audio->config.out.compression_level = audiocfg->out.compression_level;
-        audio->config.out.quality = audiocfg->out.quality;
-        audio->config.out.dynamic_range_compression = audiocfg->out.dynamic_range_compression;
-        audio->config.out.mixdown = audiocfg->out.mixdown;
-        audio->config.out.gain = audiocfg->out.gain;
-        audio->config.out.normalize_mix_level = audiocfg->out.normalize_mix_level;
-        audio->config.out.dither_method = audiocfg->out.dither_method;
-    }
-    else
-    {
-        /* Pass-through, copy from input. */
-        audio->config.out.codec = codec;
-        audio->config.out.samplerate = audio->config.in.samplerate;
-        audio->config.out.bitrate = audio->config.in.bitrate;
-        audio->config.out.mixdown = HB_AMIXDOWN_NONE;
-        audio->config.out.dynamic_range_compression = 0;
-        audio->config.out.gain = 0;
-        audio->config.out.normalize_mix_level = 0;
-        audio->config.out.compression_level = -1;
-        audio->config.out.quality = HB_INVALID_AUDIO_QUALITY;
-        audio->config.out.dither_method = hb_audio_dither_get_default();
-    }
     if (audiocfg->out.name && *audiocfg->out.name)
     {
         audio->config.out.name = strdup(audiocfg->out.name);