summaryrefslogtreecommitdiff
path: root/libavcodec/ac3enc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-04-27 15:57:34 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-05-05 12:26:34 +0200
commit39bb36d7231b4dd5eec8105903cd8e323b2c0474 (patch)
treec204ae3bd44d30f0f3bba0ed17aabd833720f9ca /libavcodec/ac3enc.c
parent32b20a274a8a628b5f255ca6641aef1c9c3b5713 (diff)
avcodec/[e]ac3enc: Allow user-supplied buffers
The size of the output buffer is always known in advance and the code has no alignment requirement (it uses mostly the PutBits API), so allowing user-supplied buffers is trivial. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/ac3enc.c')
-rw-r--r--libavcodec/ac3enc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index 8d9de8e108..0036f7d8bc 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -38,6 +38,7 @@
#include "libavutil/opt.h"
#include "libavutil/thread.h"
#include "avcodec.h"
+#include "encode.h"
#include "internal.h"
#include "me_cmp.h"
#include "put_bits.h"
@@ -1760,7 +1761,7 @@ int ff_ac3_encode_frame_common_end(AVCodecContext *avctx, AVPacket *avpkt,
ac3_quantize_mantissas(s);
- ret = ff_alloc_packet2(avctx, avpkt, s->frame_size, s->frame_size);
+ ret = ff_get_encode_buffer(avctx, avpkt, s->frame_size, 0);
if (ret < 0)
return ret;
ac3_output_frame(s, avpkt->data);