mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
v4l2slh264dec: Hold on picture buffers
These buffers should not be reused for decoding until they are no longer referenced.
This commit is contained in:
parent
b107c20198
commit
b47929a74d
1 changed files with 4 additions and 2 deletions
|
@ -548,10 +548,12 @@ finish_frame:
|
||||||
gst_v4l2_request_set_done (request);
|
gst_v4l2_request_set_done (request);
|
||||||
frame = gst_video_decoder_get_frame (GST_VIDEO_DECODER (self),
|
frame = gst_video_decoder_get_frame (GST_VIDEO_DECODER (self),
|
||||||
picture->system_frame_number);
|
picture->system_frame_number);
|
||||||
|
|
||||||
g_return_val_if_fail (frame, GST_FLOW_ERROR);
|
g_return_val_if_fail (frame, GST_FLOW_ERROR);
|
||||||
|
g_return_val_if_fail (frame->output_buffer, GST_FLOW_ERROR);
|
||||||
|
|
||||||
gst_h264_picture_set_user_data (picture, NULL, NULL);
|
/* Hold on reference buffers for the rest of the picture lifetime */
|
||||||
|
gst_h264_picture_set_user_data (picture,
|
||||||
|
gst_buffer_ref (frame->output_buffer), (GDestroyNotify) gst_buffer_unref);
|
||||||
return gst_video_decoder_finish_frame (GST_VIDEO_DECODER (self), frame);
|
return gst_video_decoder_finish_frame (GST_VIDEO_DECODER (self), frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue