diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-11-20 23:12:55 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-11-20 23:12:55 +0000 |
commit | c7a38887c1f449d87ead9bc1e30cb67226e97599 (patch) | |
tree | 4b4c9596de20abe22249c813d0ffb286bc8d7fb1 /libavformat | |
parent | 98c82d691089214251283a1c16808c10f0744ca1 (diff) | |
download | ffmpeg-c7a38887c1f449d87ead9bc1e30cb67226e97599.tar.gz |
Do D10 AES3 audio conversion in-place instead of using a large on-stack buffer.
Originally committed as revision 20567 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mxfdec.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index a815c60ea7..2f6d2eaa2f 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -214,18 +214,17 @@ static int mxf_get_stream_index(AVFormatContext *s, KLVPacket *klv) /* 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); |