msdkdec: Fix some lock issue

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3947>
This commit is contained in:
Mengkejiergeli Ba 2023-02-09 15:08:43 +08:00
parent b88b323e04
commit 4e60e91a05
2 changed files with 4 additions and 2 deletions

View file

@ -393,8 +393,8 @@ gst_msdkdec_init_decoder (GstMsdkDec * thiz)
thiz->param.AsyncDepth = thiz->async_depth;
/* We expect msdk to fill the width and height values */
g_return_val_if_fail (thiz->param.mfx.FrameInfo.Width
&& thiz->param.mfx.FrameInfo.Height, FALSE);
if (!(thiz->param.mfx.FrameInfo.Width && thiz->param.mfx.FrameInfo.Height))
goto failed;
klass->preinit_decoder (thiz);

View file

@ -106,6 +106,7 @@ static gboolean
gst_msdkmjpegdec_post_configure (GstMsdkDec * decoder)
{
/* Set the output color format based on the input color format */
GST_OBJECT_LOCK (decoder);
switch (decoder->param.mfx.JPEGChromaFormat) {
case MFX_CHROMAFORMAT_YUV422:
decoder->param.mfx.FrameInfo.FourCC = MFX_FOURCC_YUY2;
@ -116,6 +117,7 @@ gst_msdkmjpegdec_post_configure (GstMsdkDec * decoder)
break;
}
GST_OBJECT_UNLOCK (decoder);
return TRUE;
}