[FFmpeg-devel] [PATCH 3/3] avformat/webpenc: don't assume animated webp streams will have more than one packet

Carl Eugen Hoyos ceffmpeg at gmail.com
Sun Apr 11 19:30:57 EEST 2021


Am So., 11. Apr. 2021 um 04:13 Uhr schrieb James Almer <jamrial at gmail.com>:
>
> The libwebp_animencoder returns a single packet with the entire animated
> stream, as that's what the external library produces. As such, only ensure the
> stream was produced by said encoder (or propagated by a demuxer, once support
> is added) when attempting to write the requested loop value.
>
> Fixes ticket #9179.
>
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
>  libavformat/webpenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavformat/webpenc.c b/libavformat/webpenc.c
> index ed8325c02d..ca4ffc4e2d 100644
> --- a/libavformat/webpenc.c
> +++ b/libavformat/webpenc.c
> @@ -172,7 +172,7 @@ static int webp_write_trailer(AVFormatContext *s)
>      WebpContext *w = s->priv_data;
>
>      if (w->using_webp_anim_encoder) {
> -        if ((w->frame_count > 1) && w->loop) {  // Write loop count.
> +        if (w->loop) {  // Write loop count.
>              avio_seek(s->pb, 42, SEEK_SET);
>              avio_wl16(s->pb, w->loop);

Sorry for not understanding this:
Why is the seek necessary at all?

Carl Eugen


More information about the ffmpeg-devel mailing list