diff --git a/sys/msdk/gstmsdkdec.c b/sys/msdk/gstmsdkdec.c index 8c8138078c..cb81400188 100644 --- a/sys/msdk/gstmsdkdec.c +++ b/sys/msdk/gstmsdkdec.c @@ -893,16 +893,17 @@ gst_msdkdec_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame) goto done; } - if (thiz->initialized && thiz->allocation_caps) + if (!thiz->initialized) + hard_reset = TRUE; + else if (thiz->allocation_caps) { gst_video_info_from_caps (&alloc_info, thiz->allocation_caps); - /* Check whether we need complete reset for dynamic resolution change */ - if (!thiz->initialized || (thiz->initialized && - (thiz->param.mfx.FrameInfo.Width > - GST_VIDEO_INFO_WIDTH (&alloc_info) - || thiz->param.mfx.FrameInfo.Height > - GST_VIDEO_INFO_HEIGHT (&alloc_info)))) - hard_reset = TRUE; + /* Check whether we need complete reset for dynamic resolution change */ + if (thiz->param.mfx.FrameInfo.Width > GST_VIDEO_INFO_WIDTH (&alloc_info) + || thiz->param.mfx.FrameInfo.Height > + GST_VIDEO_INFO_HEIGHT (&alloc_info)) + hard_reset = TRUE; + } /* if subclass requested for the force reset */ if (thiz->force_reset_on_res_change)