From: Mark Thompson Date: Fri, 27 Jan 2017 22:03:10 +0000 (+0000) Subject: st/va: Support fractional framerate in misc parameter X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c93a157078591847a226265edf1c701d81635fc1;p=mesa.git st/va: Support fractional framerate in misc parameter Signed-off-by: Mark Thompson Acked-by: Christian König --- 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; }