]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/webpenc.c
avfilter: Remove deprecated avfilter_link_get_channels
[ffmpeg] / libavformat / webpenc.c
index d5edf892897acc061c015f7f97c4c52e5d556a71..ca4ffc4e2dd0abaed32ede79e4b32e31aa572352 100644 (file)
@@ -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);
         }
@@ -191,6 +191,13 @@ static int webp_write_trailer(AVFormatContext *s)
     return 0;
 }
 
+static void webp_deinit(AVFormatContext *s)
+{
+    WebpContext *w = s->priv_data;
+
+    av_packet_unref(&w->last_pkt);
+}
+
 #define OFFSET(x) offsetof(WebpContext, x)
 #define ENC AV_OPT_FLAG_ENCODING_PARAM
 static const AVOption options[] = {
@@ -214,6 +221,7 @@ AVOutputFormat ff_webp_muxer = {
     .init           = webp_init,
     .write_packet   = webp_write_packet,
     .write_trailer  = webp_write_trailer,
+    .deinit         = webp_deinit,
     .priv_class     = &webp_muxer_class,
     .flags          = AVFMT_VARIABLE_FPS,
 };