mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 02:00:33 +00:00
videodecoder: Try harder to push writable buffers downstream
For this release the corresponding GstVideoCodecFrame before pushing the buffer. The buffer will now be writable unless the subclass still holds another reference to the buffer or the frame.
This commit is contained in:
parent
7f6e1bdfdb
commit
0be8d14965
1 changed files with 10 additions and 1 deletions
|
@ -2446,6 +2446,14 @@ gst_video_decoder_finish_frame (GstVideoDecoder * decoder,
|
|||
* FIXME: clip_and_push_buf() changes buffer metadata but the buffer
|
||||
* might have a refcount > 1 */
|
||||
output_buffer = gst_buffer_ref (output_buffer);
|
||||
|
||||
/* Release frame so the buffer is writable when we push it downstream
|
||||
* if possible, i.e. if the subclass does not hold additional references
|
||||
* to the frame
|
||||
*/
|
||||
gst_video_decoder_release_frame (decoder, frame);
|
||||
frame = NULL;
|
||||
|
||||
if (decoder->output_segment.rate < 0.0) {
|
||||
GST_LOG_OBJECT (decoder, "queued frame");
|
||||
priv->output_queued = g_list_prepend (priv->output_queued, output_buffer);
|
||||
|
@ -2454,7 +2462,8 @@ gst_video_decoder_finish_frame (GstVideoDecoder * decoder,
|
|||
}
|
||||
|
||||
done:
|
||||
gst_video_decoder_release_frame (decoder, frame);
|
||||
if (frame)
|
||||
gst_video_decoder_release_frame (decoder, frame);
|
||||
GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue