[gst-devel] Port of ffmpeg muxers and scaler to 0.10

Michal Benes michal.benes at itonis.tv
Thu Feb 23 05:33:02 CET 2006


Edward Hervey píše v Čt 23. 02. 2006 v 13:18 +0000:
> Hi,
> 
> On 2/23/06, Michal Benes <michal.benes at itonis.tv> wrote:
> >
> > >   Good to hear :) Do you have an estimate of how long before you will
> > > have something good enough to be commited ? A release of gst-ffmpeg is
> > > really needed, but having muxers and scaler would be even better.
> >
> > Hello,
> >
> >         I think that we can post our work tomorrow morning (European time).
> > There are also quite severe memory leaks in ffmpeg encoders comming from
> > wrong use of gst_buffer_span instead of gst_buffer_join, I will post
> > this patch too.
> 
>   I'm guessing it's the ffmpegenc.c equivalent of this bug:
> http://bugzilla.gnome.org/show_bug.cgi?id=326704

Yes, it is. The only reason I have not posted the patch sooner was that
I wanted to understand the code better (and possibly find other bugs)
before just changing gst_buffer_span to gst_buffer_join ;-)

Anyway, the patch is attached. We have been testing it for some days
now.

It was a joint work of me (michal.benes at itonis.tv) and Martin
(martin.zlomek at itonis.tv)

	Michal


Index: ext/ffmpeg/gstffmpegenc.c
===================================================================
RCS file: /cvs/gstreamer/gst-ffmpeg/ext/ffmpeg/gstffmpegenc.c,v
retrieving revision 1.83
diff -u -p -r1.83 gstffmpegenc.c
--- ext/ffmpeg/gstffmpegenc.c   3 Feb 2006 18:39:38 -0000       1.83
+++ ext/ffmpeg/gstffmpegenc.c   6 Feb 2006 12:28:04 -0000
@@ -569,8 +569,7 @@ gst_ffmpegenc_chain_audio (GstPad * pad,
       if (in_size > size) {
         /* this is panic! we got a buffer, but still don't have enough
          * data. Merge them and retry in the next cycle... */
-        ffmpegenc->cache = gst_buffer_span (ffmpegenc->cache, 0, inbuf,
-                GST_BUFFER_SIZE (ffmpegenc->cache) + GST_BUFFER_SIZE
(inbuf));
+        ffmpegenc->cache = gst_buffer_join (ffmpegenc->cache, inbuf);
       } else if (in_size == size) {
         /* exactly the same! how wonderful */
         ffmpegenc->cache = inbuf;
@@ -596,8 +595,7 @@ gst_ffmpegenc_chain_audio (GstPad * pad,
       subbuf = gst_buffer_create_sub (inbuf, 0, frame_size - (in_size -
size));
       GST_BUFFER_DURATION (subbuf) =
           GST_BUFFER_DURATION (inbuf) * GST_BUFFER_SIZE (subbuf) /
size;
-      subbuf = gst_buffer_span (ffmpegenc->cache, 0, subbuf,
-              GST_BUFFER_SIZE (ffmpegenc->cache) + GST_BUFFER_SIZE
(subbuf));
+      subbuf = gst_buffer_join (ffmpegenc->cache, subbuf);
       ffmpegenc->cache = NULL;
     } else {
       subbuf = gst_buffer_create_sub (inbuf, size - in_size,
frame_size);







More information about the gstreamer-devel mailing list