From db766de13546db60cb09d6a96947ed4ca1eb6854 Mon Sep 17 00:00:00 2001 From: Thijs Vermeir Date: Wed, 20 May 2015 11:27:25 +0200 Subject: [PATCH] x265enc: Fix tune parameter mismatch There was a mismatch between the tune parameter in x265 and the enum used in this element. The value in the enum is the x265 tune parameter + 1. --- ext/x265/gstx265enc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/x265/gstx265enc.c b/ext/x265/gstx265enc.c index 39b0fb2aa5..325ab2270e 100644 --- a/ext/x265/gstx265enc.c +++ b/ext/x265/gstx265enc.c @@ -616,7 +616,7 @@ gst_x265_enc_init_encoder (GstX265Enc * encoder) if (x265_param_default_preset (&encoder->x265param, x265_preset_names[encoder->speed_preset - 1], - x265_tune_names[encoder->tune]) < 0) { + x265_tune_names[encoder->tune - 1]) < 0) { GST_DEBUG_OBJECT (encoder, "preset or tune unrecognized"); GST_OBJECT_UNLOCK (encoder); return FALSE; @@ -858,7 +858,7 @@ gst_x265_enc_set_latency (GstX265Enc * encoder) /* FIXME get a real value from the encoder, this is currently not exposed */ if (encoder->tune > 0 && encoder->tune <= G_N_ELEMENTS (x265_tune_names) && - strcmp (x265_tune_names[encoder->tune + 1], "zerolatency") == 0) + strcmp (x265_tune_names[encoder->tune - 1], "zerolatency") == 0) max_delayed_frames = 0; else max_delayed_frames = 5;