summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorSreerenj Balachandran <sreerenj.balachandran@intel.com>2018-07-02 16:50:02 -0800
committerSreerenj Balachandran <sreerenj.balachandran@intel.com>2018-07-02 16:50:02 -0800
commitd63a1b4e3fba2653fef4b9230552cf4791013150 (patch)
tree51ff043c612eb41b1b180cf73f8440101308421f /sys
parent1250af8f094b586c21104a5695636e488a9aa014 (diff)
downloadgstreamer-plugins-bad-d63a1b4e3fba2653fef4b9230552cf4791013150.tar.gz
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.
Diffstat (limited to 'sys')
-rw-r--r--sys/msdk/gstmsdkdec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/msdk/gstmsdkdec.c b/sys/msdk/gstmsdkdec.c
index a9a82c463..393d5a1d0 100644
--- a/sys/msdk/gstmsdkdec.c
+++ b/sys/msdk/gstmsdkdec.c
@@ -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);
}