From: <bi...@ke...> - 2010-05-17 17:43:46
|
Module: gst-ffmpeg Branch: master Commit: f9c246724147273700c3d4b12ec8c4976f3ac30b URL: http://cgit.freedesktop.org/gstreamer/gst-ffmpeg/commit/?id=f9c246724147273700c3d4b12ec8c4976f3ac30b Author: Edward Hervey <bi...@bi...> Date: Mon May 17 19:42:41 2010 +0200 ffmpegdec: Don't leak the GstDataPassThrough items --- ext/ffmpeg/gstffmpegdec.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c index d242ab2..d021c05 100644 --- a/ext/ffmpeg/gstffmpegdec.c +++ b/ext/ffmpeg/gstffmpegdec.c @@ -1659,6 +1659,18 @@ opaque_find (GstFFMpegDec * ffmpegdec, gpointer opaque_val, guint64 * _ts, return FALSE; } +static void +flush_opaque (GstFFMpegDec * ffmpegdec) +{ + GList *tmp; + + for (tmp = ffmpegdec->opaque; tmp; tmp = tmp->next) + g_slice_free (GstDataPassThrough, tmp->data); + if (ffmpegdec->opaque) + g_list_free (ffmpegdec->opaque); + ffmpegdec->opaque = NULL; +} + /* gst_ffmpegdec_[video|audio]_frame: * ffmpegdec: * data: pointer to the data to decode @@ -2741,6 +2753,7 @@ gst_ffmpegdec_change_state (GstElement * element, GstStateChange transition) GST_OBJECT_UNLOCK (ffmpegdec); clear_queued (ffmpegdec); g_free (ffmpegdec->padded); + flush_opaque (ffmpegdec); ffmpegdec->padded = NULL; ffmpegdec->padded_size = 0; ffmpegdec->can_allocate_aligned = TRUE; |