aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-10-13 00:01:29 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-10-18 14:46:28 +0200
commitc9e8f031955ffc00d681bd31e6ad3c8146cf015d (patch)
tree80caa0e7dc00c5084da6c04e9b4de7eaf500e262
parentcdf7619705611983724e98dee2c5659449fd0e30 (diff)
downloadffmpeg-c9e8f031955ffc00d681bd31e6ad3c8146cf015d.tar.gz
avcodec/asvenc: Simplify flushing and padding packet
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r--libavcodec/asvenc.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libavcodec/asvenc.c b/libavcodec/asvenc.c
index 054ec8ee65..49df3ffbe1 100644
--- a/libavcodec/asvenc.c
+++ b/libavcodec/asvenc.c
@@ -291,12 +291,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
emms_c();
- avpriv_align_put_bits(&a->pb);
- while (put_bits_count(&a->pb) & 31)
- put_bits(&a->pb, 8, 0);
-
flush_put_bits(&a->pb);
- size = put_bits_count(&a->pb) / 32;
+ AV_WN32(put_bits_ptr(&a->pb), 0);
+ size = (put_bits_count(&a->pb) + 31) / 32;
if (avctx->codec_id == AV_CODEC_ID_ASV1) {
a->bbdsp.bswap_buf((uint32_t *) pkt->data,