From bb8f9de8ec1a848f311e926bbd13fab094510e71 Mon Sep 17 00:00:00 2001 From: Julien BLACHE Date: Sat, 10 Sep 2011 12:12:25 +0200 Subject: [PATCH] libav 0.7: use avformat_write_header() instead of av_write_header() --- src/artwork.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/artwork.c b/src/artwork.c index c74c9b0f..eefff340 100644 --- a/src/artwork.c +++ b/src/artwork.c @@ -265,6 +265,7 @@ artwork_rescale(AVFormatContext *src_ctx, int s, int out_w, int out_h, int forma dst->width = out_w; dst->height = out_h; +#if LIBAVFORMAT_VERSION_MAJOR <= 52 || (LIBAVFORMAT_VERSION_MAJOR == 53 && LIBAVCODEC_VERSION_MINOR <= 1) ret = av_set_parameters(dst_ctx, NULL); if (ret < 0) { @@ -273,6 +274,7 @@ artwork_rescale(AVFormatContext *src_ctx, int s, int out_w, int out_h, int forma ret = -1; goto out_free_dst; } +#endif /* Open encoder */ ret = avcodec_open(dst, img_encoder); @@ -411,7 +413,11 @@ artwork_rescale(AVFormatContext *src_ctx, int s, int out_w, int out_h, int forma pkt.data = outbuf; pkt.size = ret; +#if LIBAVFORMAT_VERSION_MAJOR >= 53 || (LIBAVFORMAT_VERSION_MAJOR == 53 && LIBAVCODEC_VERSION_MINOR >= 3) + ret = avformat_write_header(dst_ctx, NULL); +#else ret = av_write_header(dst_ctx); +#endif if (ret != 0) { DPRINTF(E_LOG, L_ART, "Could not write artwork header: %s\n", strerror(AVUNERROR(ret)));