msdk: dec: set framerate to the driver only if provided

For example, if framerate 0/1 is provided from upstream, the driver
fails to configure and complain about it.

We can let it go and make the driver assuming framerate itself.

https://bugzilla.gnome.org/show_bug.cgi?id=789752
This commit is contained in:
Hyunjun Ko 2018-03-29 12:41:48 -08:00 committed by Sreerenj Balachandran
parent 0eaf3bdcd9
commit 1955ffed3f

View file

@ -256,8 +256,13 @@ gst_msdkdec_init_decoder (GstMsdkDec * thiz)
thiz->param.mfx.FrameInfo.Height = GST_ROUND_UP_32 (info->height);
thiz->param.mfx.FrameInfo.CropW = info->width;
thiz->param.mfx.FrameInfo.CropH = info->height;
thiz->param.mfx.FrameInfo.FrameRateExtN = info->fps_n;
thiz->param.mfx.FrameInfo.FrameRateExtD = info->fps_d;
/* Set framerate only if provided.
* If not, framerate will be assumed inside the driver */
if (info->fps_n > 0 && info->fps_d > 0) {
thiz->param.mfx.FrameInfo.FrameRateExtN = info->fps_n;
thiz->param.mfx.FrameInfo.FrameRateExtD = info->fps_d;
}
thiz->param.mfx.FrameInfo.AspectRatioW = info->par_n;
thiz->param.mfx.FrameInfo.AspectRatioH = info->par_d;
thiz->param.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_PROGRESSIVE;