msdkdec: avoid early destruction of frame in dynamic resolution change

In cases where we do hard resest, the current code destroys the frame
which has new resolution bit early and this causes buffer_unmap
warnings. Keep an extra ref to the frame internally to avoid this.
This commit is contained in:
Sreerenj Balachandran 2018-07-02 16:50:02 -08:00
parent 1250af8f09
commit d63a1b4e3f

View file

@ -922,6 +922,12 @@ gst_msdkdec_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame)
if (thiz->force_reset_on_res_change)
hard_reset = TRUE;
/* Config changed dynamically and we are going to do a full reset,
* this will unref the input frame which has the new configuration.
* Keep a ref to the input_frame to keep it alive */
if (thiz->initialized && thiz->do_renego)
gst_video_codec_frame_ref (frame);
gst_msdkdec_negotiate (thiz, hard_reset);
}