mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
decoder: simplify gst_vaapi_decoder_get_surface().
Avoid extraenous branches, i.e. immediately return with success once we have a decoded frame available.
This commit is contained in:
parent
a811a5de3d
commit
b24752da4f
1 changed files with 6 additions and 12 deletions
|
@ -659,21 +659,15 @@ gst_vaapi_decoder_get_surface(GstVaapiDecoder *decoder,
|
|||
|
||||
do {
|
||||
frame = pop_frame(decoder);
|
||||
if (frame)
|
||||
break;
|
||||
if (frame) {
|
||||
*out_proxy_ptr = gst_vaapi_surface_proxy_ref(frame->user_data);
|
||||
gst_video_codec_frame_unref(frame);
|
||||
return GST_VAAPI_DECODER_STATUS_SUCCESS;
|
||||
}
|
||||
status = decode_step(decoder);
|
||||
} while (status == GST_VAAPI_DECODER_STATUS_SUCCESS);
|
||||
|
||||
if (frame) {
|
||||
*out_proxy_ptr = gst_vaapi_surface_proxy_ref(frame->user_data);
|
||||
gst_video_codec_frame_unref(frame);
|
||||
status = GST_VAAPI_DECODER_STATUS_SUCCESS;
|
||||
}
|
||||
else {
|
||||
*out_proxy_ptr = NULL;
|
||||
if (status == GST_VAAPI_DECODER_STATUS_SUCCESS)
|
||||
status = GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA;
|
||||
}
|
||||
*out_proxy_ptr = NULL;
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue