mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 20:42:30 +00:00
codecs: mpeg2decoder: Move frame_unref to handle_frame.
In the current code, we call frame_unref only when the frame is outputted. This is OK for normal playback, but when seek happens, the frames stored in DPB is not outputted and causes some memory leak. The correct way is that we should call frame_unref every time we finish the handle_frame(), which is also the behaviour of H264/H265 decoder. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2014>
This commit is contained in:
parent
e8df47b022
commit
636a77a83f
1 changed files with 1 additions and 2 deletions
|
@ -1053,8 +1053,6 @@ gst_mpeg2_decoder_do_output_picture (GstMpeg2Decoder * decoder,
|
|||
GST_TIME_ARGS (frame->pts));
|
||||
ret = klass->output_picture (decoder, frame, to_output);
|
||||
|
||||
gst_video_codec_frame_unref (frame);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1159,6 +1157,7 @@ gst_mpeg2_decoder_handle_frame (GstVideoDecoder * decoder,
|
|||
ret = gst_mpeg2_decoder_output_current_picture (self);
|
||||
gst_mpeg2_picture_clear (&priv->current_picture);
|
||||
gst_mpeg2_picture_clear (&priv->first_field);
|
||||
gst_video_codec_frame_unref (priv->current_frame);
|
||||
priv->current_frame = NULL;
|
||||
return ret;
|
||||
|
||||
|
|
Loading…
Reference in a new issue