mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 00:01:23 +00:00
basevideo: Add destroy notify for the coder_hook to prevent memory leaks
Fixes bug #654293.
This commit is contained in:
parent
6f2c2609ac
commit
fc93c66d3b
3 changed files with 8 additions and 0 deletions
|
@ -182,5 +182,8 @@ gst_base_video_codec_free_frame (GstVideoFrame * frame)
|
|||
gst_buffer_unref (frame->src_buffer);
|
||||
}
|
||||
|
||||
if (frame->coder_hook_destroy_notify && frame->coder_hook)
|
||||
frame->coder_hook_destroy_notify (frame->coder_hook);
|
||||
|
||||
g_free (frame);
|
||||
}
|
||||
|
|
|
@ -125,6 +125,8 @@ struct _GstVideoFrame
|
|||
int n_fields;
|
||||
|
||||
void *coder_hook;
|
||||
GDestroyNotify coder_hook_destroy_notify;
|
||||
|
||||
GstClockTime deadline;
|
||||
|
||||
gboolean force_keyframe;
|
||||
|
|
|
@ -1288,6 +1288,9 @@ gst_base_video_decoder_free_frame (GstVideoFrame * frame)
|
|||
gst_buffer_unref (frame->src_buffer);
|
||||
}
|
||||
|
||||
if (frame->coder_hook_destroy_notify && frame->coder_hook)
|
||||
frame->coder_hook_destroy_notify (frame->coder_hook);
|
||||
|
||||
g_free (frame);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue