summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2017-04-12 13:22:24 -0600
committerJohn Stebbins <[email protected]>2017-04-12 13:22:24 -0600
commit9a22ae2b2715b088cd936ba5e7d700ee4fbea096 (patch)
tree727780826da93136b5aea3672a6782875e237dee
parent420f90fe9efdb44049f783f93f6378f7785e532d (diff)
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.
-rw-r--r--libhb/preset.c9
1 files 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)
{