basevideo: Add destroy notify for the coder_hook to prevent memory leaks

Fixes bug #654293.
This commit is contained in:
Sebastian Dröge 2011-07-09 10:57:52 +02:00
parent c62dd0f0c3
commit f79460ff52
3 changed files with 8 additions and 0 deletions

View file

@ -188,5 +188,8 @@ gst_base_video_codec_free_frame (GstVideoFrame * frame)
g_list_foreach (frame->events, (GFunc) gst_event_unref, NULL);
g_list_free (frame->events);
if (frame->coder_hook_destroy_notify && frame->coder_hook)
frame->coder_hook_destroy_notify (frame->coder_hook);
g_free (frame);
}

View file

@ -126,6 +126,8 @@ struct _GstVideoFrame
int n_fields;
void *coder_hook;
GDestroyNotify coder_hook_destroy_notify;
GstClockTime deadline;
gboolean force_keyframe;

View file

@ -1323,6 +1323,9 @@ gst_base_video_decoder_free_frame (GstVideoFrame * frame)
g_list_foreach (frame->events, (GFunc) gst_event_unref, NULL);
g_list_free (frame->events);
if (frame->coder_hook_destroy_notify && frame->coder_hook)
frame->coder_hook_destroy_notify (frame->coder_hook);
g_free (frame);
}