From 9a22ae2b2715b088cd936ba5e7d700ee4fbea096 Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Wed, 12 Apr 2017 13:22:24 -0600 Subject: [PATCH] preset: fix sanitizing audio settings when samplerate != Auto The samplerate was incorrectly copied to the job as a string instead of an int which caused invalid sanitizing of audio settings. --- libhb/preset.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libhb/preset.c b/libhb/preset.c index 0b7f37734..05efa6a65 100644 --- a/libhb/preset.c +++ b/libhb/preset.c @@ -694,8 +694,13 @@ static void add_audio_for_lang(hb_value_array_t *list, const hb_dict_t *preset, } if (hb_dict_get(encoder_dict, "AudioSamplerate") != NULL) { - hb_dict_set(audio_dict, "Samplerate", hb_value_dup( - hb_dict_get(encoder_dict, "AudioSamplerate"))); + const char * sr_name; + int sr; + + sr_name = hb_dict_get_string(encoder_dict, + "AudioSamplerate"); + sr = hb_audio_samplerate_get_from_name(sr_name); + hb_dict_set(audio_dict, "Samplerate", hb_value_int(sr)); } if (hb_dict_get(encoder_dict, "AudioCompressionLevel") != NULL) { -- 2.40.0