summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2019-02-02 17:51:35 +0100
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2019-02-02 17:52:58 +0100
commitf974246647cd6e895247cfa5b63b5532bbf40188 (patch)
treec82c900d785315277989e91ae0806d883e8725bd
parent74f297f31b98ebacdaaf523fcc0cbc48a8c307bc (diff)
downloadgstreamer-plugins-bad-f974246647cd6e895247cfa5b63b5532bbf40188.tar.gz
msdkdec: explain the the extra ref of input buffer
-rw-r--r--sys/msdk/gstmsdkdec.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/msdk/gstmsdkdec.c b/sys/msdk/gstmsdkdec.c
index 5ee5d593a..9cc5e28cd 100644
--- a/sys/msdk/gstmsdkdec.c
+++ b/sys/msdk/gstmsdkdec.c
@@ -878,6 +878,13 @@ gst_msdkdec_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame)
}
}
+ /* Current frame-codec could be pushed and released before this
+ * function ends -- because msdkdec pushes the oldest frame,
+ * according its PTS, and it could be this very same frame-codec
+ * among others pending frame-codecs.
+ *
+ * Instead of copying the input data into the mfxBitstream, let's
+ * keep an extra reference to frame-codec's input buffer */
input_buffer = gst_buffer_ref (frame->input_buffer);
if (!gst_buffer_map (input_buffer, &map_info, GST_MAP_READ)) {
gst_buffer_unref (input_buffer);