va: baseenc: Do not clear the codec frame twice when error.
authorHe Junyan <junyan.he@intel.com>
Fri, 8 Jul 2022 13:57:40 +0000 (21:57 +0800)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 11 Jul 2022 10:12:29 +0000 (10:12 +0000)
The current manner will clear the input codec frame twice if we fail
to push the output data, which will trigger an assert.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2739>

subprojects/gst-plugins-bad/sys/va/gstvabaseenc.c

index 0537b78..cb3b70e 100644 (file)
@@ -624,11 +624,12 @@ gst_va_base_enc_drain (GstVideoEncoder * venc)
     if (ret != GST_FLOW_OK)
       goto error_and_purge_all;
 
+    frame_enc = NULL;
+
     ret = _push_out_one_buffer (base);
     if (ret != GST_FLOW_OK)
       goto error_and_purge_all;
 
-    frame_enc = NULL;
     if (!base_class->reorder_frame (base, NULL, TRUE, &frame_enc)) {
       ret = GST_FLOW_ERROR;
       goto error_and_purge_all;