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 6f2c2609ac
commit fc93c66d3b
3 changed files with 8 additions and 0 deletions

View file

@ -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);
}

View file

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

View file

@ -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);
}