diff mbox series

[FFmpeg-devel,01/27] avformat/astenc: Simplify writing padding

Message ID AM7PR03MB6660B53FD728C8696414D3418FA39@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 6e26015a6b34f954065d4be8a29ad7941334c490
Headers show
Series [FFmpeg-devel,01/27] avformat/astenc: Simplify writing padding | expand

Commit Message

Andreas Rheinhardt Sept. 23, 2021, 3:06 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/astenc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

James Almer Sept. 23, 2021, 3:25 p.m. UTC | #1
On 9/23/2021 12:06 PM, Andreas Rheinhardt wrote:
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>   libavformat/astenc.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/libavformat/astenc.c b/libavformat/astenc.c
> index cf75b48b21..a5792e0b07 100644
> --- a/libavformat/astenc.c
> +++ b/libavformat/astenc.c
> @@ -118,9 +118,7 @@ static int ast_write_packet(AVFormatContext *s, AVPacket *pkt)
>       avio_wb32(pb, size); /* Block size */
>   
>       /* padding */
> -    avio_wb64(pb, 0);
> -    avio_wb64(pb, 0);
> -    avio_wb64(pb, 0);
> +    ffio_fill(pb, 0, 24);

Should be ok.

>   
>       avio_write(pb, pkt->data, pkt->size);
>   
>
Paul B Mahol Sept. 23, 2021, 3:33 p.m. UTC | #2
lgtm
diff mbox series

Patch

diff --git a/libavformat/astenc.c b/libavformat/astenc.c
index cf75b48b21..a5792e0b07 100644
--- a/libavformat/astenc.c
+++ b/libavformat/astenc.c
@@ -118,9 +118,7 @@  static int ast_write_packet(AVFormatContext *s, AVPacket *pkt)
     avio_wb32(pb, size); /* Block size */
 
     /* padding */
-    avio_wb64(pb, 0);
-    avio_wb64(pb, 0);
-    avio_wb64(pb, 0);
+    ffio_fill(pb, 0, 24);
 
     avio_write(pb, pkt->data, pkt->size);