+2005-01-16 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
+
+ * ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_chain_video):
+ Unref after encode (#162905).
+
2005-01-16 Luca Ognibene <luogni@tin.it>
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
static void
gst_ffmpegenc_chain_video (GstPad * pad, GstData * _data)
{
- GstBuffer *inbuf = GST_BUFFER (_data);
GstFFMpegEnc *ffmpegenc = (GstFFMpegEnc *) (gst_pad_get_parent (pad));
+ GstBuffer *inbuf = GST_BUFFER (_data), *old_cache = ffmpegenc->cache;
GstFFMpegEncClass *oclass =
(GstFFMpegEncClass *) (G_OBJECT_GET_CLASS (ffmpegenc));
gint ret_size = 0;
/* FIXME: events (discont (flush!) and eos (close down) etc.) */
- if (NULL != ffmpegenc->cache)
- gst_buffer_unref (ffmpegenc->cache);
ffmpegenc->cache = gst_buffer_new_and_alloc (ffmpegenc->buffer_size);
ret_size = avcodec_encode_video (ffmpegenc->context,
GST_BUFFER_DATA (ffmpegenc->cache),
GST_BUFFER_MAXSIZE (ffmpegenc->cache), ffmpegenc->picture);
+ if (old_cache)
+ gst_buffer_unref (old_cache);
if (ret_size < 0) {
GST_ELEMENT_ERROR (ffmpegenc, LIBRARY, ENCODE, (NULL),