]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/libwebpenc.c
d3d11va: make av_d3d11va_alloc_context() available at all times
[ffmpeg] / libavcodec / libwebpenc.c
index 74e73dc8cbb994a5f50ec96f48ee6e5e60f8668d..ef311b75921f64ad0cbc2daa6efd773059adf70c 100644 (file)
@@ -161,9 +161,7 @@ static int libwebp_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
             ret = av_frame_get_buffer(alt_frame, 32);
             if (ret < 0)
                 goto end;
-            av_image_copy(alt_frame->data, alt_frame->linesize,
-                          frame->data, frame->linesize,
-                          avctx->pix_fmt, frame->width, frame->height);
+            av_frame_copy(alt_frame, frame);
             frame = alt_frame;
         }
         pic->use_argb  = 0;
@@ -233,7 +231,11 @@ static int libwebp_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     *got_packet = 1;
 
 end:
+#if (WEBP_ENCODER_ABI_VERSION > 0x0203)
+    WebPMemoryWriterClear(&mw);
+#else
     free(mw.mem); /* must use free() according to libwebp documentation */
+#endif
     WebPPictureFree(pic);
     av_freep(&pic);
     av_frame_free(&alt_frame);