From c93a157078591847a226265edf1c701d81635fc1 Mon Sep 17 00:00:00 2001 From: Mark Thompson Date: Fri, 27 Jan 2017 22:03:10 +0000 Subject: [PATCH] st/va: Support fractional framerate in misc parameter MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Mark Thompson Acked-by: Christian König --- src/gallium/state_trackers/va/picture.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/va/picture.c b/src/gallium/state_trackers/va/picture.c index 53bb9eb9e32..ef8b57a47f5 100644 --- a/src/gallium/state_trackers/va/picture.c +++ b/src/gallium/state_trackers/va/picture.c @@ -348,7 +348,13 @@ static VAStatus handleVAEncMiscParameterTypeFrameRate(vlVaContext *context, VAEncMiscParameterBuffer *misc) { VAEncMiscParameterFrameRate *fr = (VAEncMiscParameterFrameRate *)misc->data; - context->desc.h264enc.rate_ctrl.frame_rate_num = fr->framerate; + if (fr->framerate & 0xffff0000) { + context->desc.h264enc.rate_ctrl.frame_rate_num = fr->framerate & 0xffff; + context->desc.h264enc.rate_ctrl.frame_rate_den = fr->framerate >> 16 & 0xffff; + } else { + context->desc.h264enc.rate_ctrl.frame_rate_num = fr->framerate; + context->desc.h264enc.rate_ctrl.frame_rate_den = 1; + } return VA_STATUS_SUCCESS; } -- 2.30.2