va: baseenc: No need to check the frame pointer in handle_frame().

No need to check the NULL pointer of "frame" in error handling, it
is assured non-NULL by base class and we already use it everywhere
in this function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2471>
This commit is contained in:
He Junyan 2022-05-23 15:03:03 +08:00
parent de5952bc83
commit fc75e38496

View file

@ -564,20 +564,16 @@ error_new_frame:
{ {
GST_ELEMENT_ERROR (venc, STREAM, ENCODE, GST_ELEMENT_ERROR (venc, STREAM, ENCODE,
("Failed to create the input frame."), (NULL)); ("Failed to create the input frame."), (NULL));
if (frame) {
gst_clear_buffer (&frame->output_buffer); gst_clear_buffer (&frame->output_buffer);
gst_video_encoder_finish_frame (venc, frame); gst_video_encoder_finish_frame (venc, frame);
}
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
error_reorder: error_reorder:
{ {
GST_ELEMENT_ERROR (venc, STREAM, ENCODE, GST_ELEMENT_ERROR (venc, STREAM, ENCODE,
("Failed to reorder the input frame."), (NULL)); ("Failed to reorder the input frame."), (NULL));
if (frame) {
gst_clear_buffer (&frame->output_buffer); gst_clear_buffer (&frame->output_buffer);
gst_video_encoder_finish_frame (venc, frame); gst_video_encoder_finish_frame (venc, frame);
}
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
error_encode: error_encode: