From: <rb...@fr...> - 2005-01-16 12:15:26
|
CVS Root: /cvs/gstreamer Module: gst-ffmpeg Changes by: rbultje Date: Sun Jan 16 2005 04:15:22 PST Log message: * ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_chain_video): Unref after encode (#162905). Modified files: . : ChangeLog ext/ffmpeg : gstffmpegenc.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-ffmpeg/ChangeLog.diff?r1=1.113&r2=1.114 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-ffmpeg/ext/ffmpeg/gstffmpegenc.c.diff?r1=1.56&r2=1.57 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-ffmpeg/ChangeLog,v retrieving revision 1.113 retrieving revision 1.114 diff -u -d -r1.113 -r1.114 --- ChangeLog 16 Jan 2005 11:29:28 -0000 1.113 +++ ChangeLog 16 Jan 2005 12:15:09 -0000 1.114 @@ -1,3 +1,8 @@ +2005-01-16 Ronald S. Bultje <rb...@ro...> + + * ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_chain_video): + Unref after encode (#162905). 2005-01-16 Luca Ognibene <lu...@ti...> Reviewed by: Ronald S. Bultje <rb...@ro...> Index: gstffmpegenc.c RCS file: /cvs/gstreamer/gst-ffmpeg/ext/ffmpeg/gstffmpegenc.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- gstffmpegenc.c 16 Jan 2005 11:29:28 -0000 1.56 +++ gstffmpegenc.c 16 Jan 2005 12:15:10 -0000 1.57 @@ -458,15 +458,13 @@ 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); @@ -481,6 +479,8 @@ 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), |