va: baseenc: Do not clear the codec frame twice when error.

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>
This commit is contained in:
He Junyan 2022-07-08 21:57:40 +08:00 committed by GStreamer Marge Bot
parent 3385ea3481
commit 27c33f0161

View file

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