mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 12:32:29 +00:00
msdkdec: Fix buffer allocation based on frame.
gst_msdkdec_finish_task() may release all frames in GstVideoDecoder object. In this case, allocate_output_buffer() cannot get the oldest frame to allocate buffer. So gst_msdkdec_handle_frame() should return GST_FLOW_OK for letting gst_video_decoder_decode_frame() to send a new frame for decoding. Fixes #664. Fixes #665.
This commit is contained in:
parent
e4c4f193f2
commit
f92b5614db
1 changed files with 5 additions and 2 deletions
|
@ -137,7 +137,7 @@ allocate_output_buffer (GstMsdkDec * thiz, GstBuffer ** buffer)
|
|||
if (GST_PAD_IS_FLUSHING (decoder->srcpad))
|
||||
return GST_FLOW_FLUSHING;
|
||||
else
|
||||
return GST_FLOW_ERROR;
|
||||
return GST_FLOW_CUSTOM_SUCCESS;
|
||||
}
|
||||
|
||||
if (!frame->output_buffer) {
|
||||
|
@ -994,7 +994,10 @@ gst_msdkdec_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame)
|
|||
goto error;
|
||||
if (!surface) {
|
||||
flow = allocate_output_buffer (thiz, &buffer);
|
||||
if (flow != GST_FLOW_OK)
|
||||
if (flow == GST_FLOW_CUSTOM_SUCCESS) {
|
||||
flow = GST_FLOW_OK;
|
||||
break;
|
||||
} else if (flow != GST_FLOW_OK)
|
||||
goto error;
|
||||
surface = get_surface (thiz, buffer);
|
||||
if (!surface) {
|
||||
|
|
Loading…
Reference in a new issue