diff mbox series

[FFmpeg-devel,1/3] avcodec/libwebpenc_animencoder: stop propagating bogus empty packets

Message ID 20210411021238.29014-1-jamrial@gmail.com
State Accepted
Commit ab7a0a4cc23e3ff222714a58ce24fc6287a68585
Headers show
Series [FFmpeg-devel,1/3] avcodec/libwebpenc_animencoder: stop propagating bogus empty packets
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

James Almer April 11, 2021, 2:12 a.m. UTC
Packets must have at least one of data or side_data. If none are available,
then got_packet must not be signaled.

The generic encode code already discarded these empty packets, but it's better
just not propagating them at all.

Signed-off-by: James Almer <jamrial@gmail.com>
---
This patchset supersedes "avcodec/libwebpenc_animencoder: Don't return pkt
without data/side-data" and "avformat/webpenc: Don't treat zero-sized packets
as invalid".

 libavcodec/libwebpenc_animencoder.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

James Almer April 16, 2021, 1:48 p.m. UTC | #1
On 4/10/2021 11:12 PM, James Almer wrote:
> Packets must have at least one of data or side_data. If none are available,
> then got_packet must not be signaled.
> 
> The generic encode code already discarded these empty packets, but it's better
> just not propagating them at all.
> 
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
> This patchset supersedes "avcodec/libwebpenc_animencoder: Don't return pkt
> without data/side-data" and "avformat/webpenc: Don't treat zero-sized packets
> as invalid".
> 
>   libavcodec/libwebpenc_animencoder.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/libavcodec/libwebpenc_animencoder.c b/libavcodec/libwebpenc_animencoder.c
> index 7f35a0b939..633af2e925 100644
> --- a/libavcodec/libwebpenc_animencoder.c
> +++ b/libavcodec/libwebpenc_animencoder.c
> @@ -102,10 +102,9 @@ static int libwebp_anim_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
>               goto end;
>           }
>   
> -        pkt->pts = pkt->dts = frame->pts;
>           s->prev_frame_pts = frame->pts;  // Save for next frame.
>           ret = 0;
> -        *got_packet = 1;
> +        *got_packet = 0;
>   
>   end:
>           WebPPictureFree(pic);

Will apply the set.
diff mbox series

Patch

diff --git a/libavcodec/libwebpenc_animencoder.c b/libavcodec/libwebpenc_animencoder.c
index 7f35a0b939..633af2e925 100644
--- a/libavcodec/libwebpenc_animencoder.c
+++ b/libavcodec/libwebpenc_animencoder.c
@@ -102,10 +102,9 @@  static int libwebp_anim_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
             goto end;
         }
 
-        pkt->pts = pkt->dts = frame->pts;
         s->prev_frame_pts = frame->pts;  // Save for next frame.
         ret = 0;
-        *got_packet = 1;
+        *got_packet = 0;
 
 end:
         WebPPictureFree(pic);