Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@gmail.com>
---
 libavcodec/asvenc.c | 7 ++-----
 1 file 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,
-- 
2.25.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to