diff mbox series

[FFmpeg-devel,1/2] avcodec/vc2enc: Actually zero padding

Message ID HE1PR0301MB215418BDCD991B4B3C19940B8F429@HE1PR0301MB2154.eurprd03.prod.outlook.com
State Accepted
Commit aa2e0b868df559a17a10fc40578617bc254885b8
Headers show
Series [FFmpeg-devel,1/2] avcodec/vc2enc: Actually zero padding
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt April 26, 2021, 5:15 p.m. UTC
This encoder sets the min_size in ff_alloc_packet2(), so it can not rely
on av_packet_make_refcounted() to zero the padding.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/vc2enc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Moritz Barsnick April 27, 2021, 2:14 p.m. UTC | #1
On Mon, Apr 26, 2021 at 19:15:10 +0200, Andreas Rheinhardt wrote:

> Subject: [PATCH 1/2] avcodec/vc2enc: Actually zero padding

Dieser Satz kein Verb.
In other words: I think you meant to write: "Actually apply zero
padding".

Cheers,
Moritz
Andreas Rheinhardt April 27, 2021, 2:17 p.m. UTC | #2
Moritz Barsnick:
> On Mon, Apr 26, 2021 at 19:15:10 +0200, Andreas Rheinhardt wrote:
> 
>> Subject: [PATCH 1/2] avcodec/vc2enc: Actually zero padding
> 
> Dieser Satz kein Verb.
> In other words: I think you meant to write: "Actually apply zero
> padding".
> 
zero is the verb.

- Andreas
James Almer April 27, 2021, 2:20 p.m. UTC | #3
On 4/27/2021 11:17 AM, Andreas Rheinhardt wrote:
> Moritz Barsnick:
>> On Mon, Apr 26, 2021 at 19:15:10 +0200, Andreas Rheinhardt wrote:
>>
>>> Subject: [PATCH 1/2] avcodec/vc2enc: Actually zero padding
>>
>> Dieser Satz kein Verb.
>> In other words: I think you meant to write: "Actually apply zero
>> padding".
>>
> zero is the verb.
> 
> - Andreas

You could change it to "Actually zero the padding", so it's clear that's 
the case.
Andreas Rheinhardt April 27, 2021, 2:38 p.m. UTC | #4
James Almer:
> On 4/27/2021 11:17 AM, Andreas Rheinhardt wrote:
>> Moritz Barsnick:
>>> On Mon, Apr 26, 2021 at 19:15:10 +0200, Andreas Rheinhardt wrote:
>>>
>>>> Subject: [PATCH 1/2] avcodec/vc2enc: Actually zero padding
>>>
>>> Dieser Satz kein Verb.
>>> In other words: I think you meant to write: "Actually apply zero
>>> padding".
>>>
>> zero is the verb.
>>
>> - Andreas
> 
> You could change it to "Actually zero the padding", so it's clear that's
> the case.

Lynne approved it yesterday on IRC, so I have already pushed it.

- Andreas
Moritz Barsnick April 27, 2021, 2:41 p.m. UTC | #5
On Tue, Apr 27, 2021 at 16:17:55 +0200, Andreas Rheinhardt wrote:
> Moritz Barsnick:
> > In other words: I think you meant to write: "Actually apply zero
> > padding".
> zero is the verb.

Ouch. Touché and thanks.
Moritz
diff mbox series

Patch

diff --git a/libavcodec/vc2enc.c b/libavcodec/vc2enc.c
index 7bd2e4c2ab..6c2e873a23 100644
--- a/libavcodec/vc2enc.c
+++ b/libavcodec/vc2enc.c
@@ -993,7 +993,7 @@  static av_cold int vc2_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
     }
 
     flush_put_bits(&s->pb);
-    avpkt->size = put_bits_count(&s->pb) >> 3;
+    av_shrink_packet(avpkt, put_bytes_output(&s->pb));
 
     *got_packet = 1;