From: John Stebbins Date: Wed, 12 Apr 2017 19:22:24 +0000 (-0600) Subject: preset: fix sanitizing audio settings when samplerate != Auto X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8db8e858688d10ca9a125f4be63d0896d417fa31;p=handbrake 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. (cherry picked from commit 9a22ae2b2715b088cd936ba5e7d700ee4fbea096) --- 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) {