From 64c04a126491e984e010ff097b89bcc275782172 Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Mon, 13 Jul 2020 08:28:55 -0600 Subject: LinGui: fix fastdecode tune error with x265 If fastdecode was set while encoder was x264, the value would be used when the codec was changed to x265. Fixes https://github.com/HandBrake/HandBrake/issues/3005 --- gtk/src/presets.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/gtk/src/presets.c b/gtk/src/presets.c index b9edb60bb..dd0a5b96f 100644 --- a/gtk/src/presets.c +++ b/gtk/src/presets.c @@ -1768,14 +1768,18 @@ ghb_settings_to_preset(GhbValue *settings) g_string_append_printf(str, "%s", tune); sep = ","; } - if (ghb_dict_get_bool(preset, "x264FastDecode")) + int encoder = ghb_get_video_encoder(settings); + if (encoder & HB_VCODEC_X264_MASK) { - g_string_append_printf(str, "%s%s", sep, "fastdecode"); - sep = ","; - } - if (ghb_dict_get_bool(preset, "x264ZeroLatency")) - { - g_string_append_printf(str, "%s%s", sep, "zerolatency"); + if (ghb_dict_get_bool(preset, "x264FastDecode")) + { + g_string_append_printf(str, "%s%s", sep, "fastdecode"); + sep = ","; + } + if (ghb_dict_get_bool(preset, "x264ZeroLatency")) + { + g_string_append_printf(str, "%s%s", sep, "zerolatency"); + } } char *tunes; tunes = g_string_free(str, FALSE); -- cgit v1.2.3