mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
videodecoder: don't leak events
When need to push out all the previously received events, concatenate all the events from the previous frames (instead of leaking the old ones) Improve debugging a little Conflicts: gst-libs/gst/video/gstvideodecoder.c
This commit is contained in:
parent
8fde7850c0
commit
34bfcb2af9
2 changed files with 6 additions and 4 deletions
|
@ -1778,7 +1778,7 @@ gst_video_decoder_prepare_finish_frame (GstVideoDecoder *
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GST_LOG_OBJECT (decoder,
|
GST_LOG_OBJECT (decoder,
|
||||||
"finish frame sync=%d pts=%" GST_TIME_FORMAT,
|
"finish frame %p sync=%d pts=%" GST_TIME_FORMAT, frame,
|
||||||
GST_VIDEO_CODEC_FRAME_IS_SYNC_POINT (frame), GST_TIME_ARGS (frame->pts));
|
GST_VIDEO_CODEC_FRAME_IS_SYNC_POINT (frame), GST_TIME_ARGS (frame->pts));
|
||||||
|
|
||||||
/* Push all pending events that arrived before this frame */
|
/* Push all pending events that arrived before this frame */
|
||||||
|
@ -1786,7 +1786,7 @@ gst_video_decoder_prepare_finish_frame (GstVideoDecoder *
|
||||||
GstVideoCodecFrame *tmp = l->data;
|
GstVideoCodecFrame *tmp = l->data;
|
||||||
|
|
||||||
if (tmp->events) {
|
if (tmp->events) {
|
||||||
events = tmp->events;
|
events = g_list_concat (events, tmp->events);
|
||||||
tmp->events = NULL;
|
tmp->events = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1894,7 +1894,7 @@ gst_video_decoder_drop_frame (GstVideoDecoder * dec, GstVideoCodecFrame * frame)
|
||||||
GstMessage *qos_msg;
|
GstMessage *qos_msg;
|
||||||
gdouble proportion;
|
gdouble proportion;
|
||||||
|
|
||||||
GST_LOG_OBJECT (dec, "drop frame");
|
GST_LOG_OBJECT (dec, "drop frame %p", frame);
|
||||||
|
|
||||||
GST_VIDEO_DECODER_STREAM_LOCK (dec);
|
GST_VIDEO_DECODER_STREAM_LOCK (dec);
|
||||||
|
|
||||||
|
@ -1954,7 +1954,7 @@ gst_video_decoder_finish_frame (GstVideoDecoder * decoder,
|
||||||
guint64 start, stop;
|
guint64 start, stop;
|
||||||
GstSegment *segment;
|
GstSegment *segment;
|
||||||
|
|
||||||
GST_LOG_OBJECT (decoder, "finish frame");
|
GST_LOG_OBJECT (decoder, "finish frame %p", frame);
|
||||||
|
|
||||||
if (G_UNLIKELY (priv->output_state_changed || (priv->output_state
|
if (G_UNLIKELY (priv->output_state_changed || (priv->output_state
|
||||||
&& gst_pad_check_reconfigure (decoder->srcpad))))
|
&& gst_pad_check_reconfigure (decoder->srcpad))))
|
||||||
|
|
|
@ -36,6 +36,8 @@ _gst_video_codec_frame_free (GstVideoCodecFrame * frame)
|
||||||
{
|
{
|
||||||
g_return_if_fail (frame != NULL);
|
g_return_if_fail (frame != NULL);
|
||||||
|
|
||||||
|
GST_DEBUG ("free frame %p", frame);
|
||||||
|
|
||||||
if (frame->input_buffer) {
|
if (frame->input_buffer) {
|
||||||
gst_buffer_unref (frame->input_buffer);
|
gst_buffer_unref (frame->input_buffer);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue