[FFmpeg-cvslog] atrac3: replace a calculation with FFALIGN()
Justin Ruggles
git at videolan.org
Tue Oct 23 13:12:08 CEST 2012
ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Thu Oct 18 23:51:37 2012 -0400| [a1f4cd371ac7ff9fea6f0d3072fc886380160844] | committer: Justin Ruggles
atrac3: replace a calculation with FFALIGN()
This allocates 4 bytes less than the previous code if avctx->block_align is
a multiple of 4, but the extra 4 bytes is not really needed.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a1f4cd371ac7ff9fea6f0d3072fc886380160844
---
libavcodec/atrac3.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
index 66c672a..9cf9892 100644
--- a/libavcodec/atrac3.c
+++ b/libavcodec/atrac3.c
@@ -947,8 +947,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
if (avctx->block_align >= UINT_MAX / 2)
return AVERROR(EINVAL);
- q->decoded_bytes_buffer = av_mallocz(avctx->block_align +
- (4 - avctx->block_align % 4) +
+ q->decoded_bytes_buffer = av_mallocz(FFALIGN(avctx->block_align, 4) +
FF_INPUT_BUFFER_PADDING_SIZE);
if (q->decoded_bytes_buffer == NULL)
return AVERROR(ENOMEM);
More information about the ffmpeg-cvslog
mailing list