[FFmpeg-devel] Stack usage in FFmpeg

Reimar Döffinger Reimar.Doeffinger
Fri Nov 20 23:46:15 CET 2009


On Fri, Nov 20, 2009 at 02:11:24PM -0800, Baptiste Coudurier wrote:
> On 11/20/2009 01:57 PM, Reimar D?ffinger wrote:
> >On Sun, Nov 01, 2009 at 08:50:15PM +0000, M?ns Rullg?rd wrote:
> >>   61440 mxf_get_d10_aes3_packet        mxfdec.c:216
> >
> >This seems really silly,
> 
> Please spare the useless comment.
> 
> >unless I miss something this could just be done in-place...
> 
> Seems so.

It's not a useless comment, if it seems silly that usually means I missed
something.

> >Index: libavformat/mxfdec.c
> >===================================================================
> >--- libavformat/mxfdec.c	(revision 20562)
> >+++ libavformat/mxfdec.c	(working copy)
> >@@ -214,18 +214,17 @@
> >  /* XXX: use AVBitStreamFilter */
> >  static int mxf_get_d10_aes3_packet(ByteIOContext *pb, AVStream *st, AVPacket *pkt, int64_t length)
> >  {
> >-    uint8_t buffer[61444];
> >      const uint8_t *buf_ptr, *end_ptr;
> >      uint8_t *data_ptr;
> >      int i;
> >
> >      if (length>  61444) /* worst case PAL 1920 samples 8 channels */
> >          return -1;
> >-    get_buffer(pb, buffer, length);
> >      av_new_packet(pkt, length);
> >+    get_buffer(pb, pkt->data, length);
> >      data_ptr = pkt->data;
> >-    end_ptr = buffer + length;
> >-    buf_ptr = buffer + 4; /* skip SMPTE 331M header */
> >+    end_ptr = pkt->data + length;
> >+    buf_ptr = pkt->data + 4; /* skip SMPTE 331M header */
> >      for (; buf_ptr<  end_ptr; ) {
> >          for (i = 0; i<  st->codec->channels; i++) {
> >              uint32_t sample = bytestream_get_le32(&buf_ptr);
> 
> Should be ok if it works.

Right, that's the part I forgot to write: know of a sample file to test?
Or the specific command line to create one (if our muxer supports it)?



More information about the ffmpeg-devel mailing list