diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2012-11-03 18:06:23 +0100 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2012-11-03 18:22:56 +0100 |
commit | e6a6a602760387f2270bab0cab8426e178374f96 (patch) | |
tree | cf139afe2d070a1b5a19acc491cc5771402af108 | |
parent | 6e6fc03828e4f88c975d086b2a9f30a8263ae6e7 (diff) | |
download | mpv-e6a6a602760387f2270bab0cab8426e178374f96.tar.bz2 mpv-e6a6a602760387f2270bab0cab8426e178374f96.tar.xz |
libav_compat: fix mmx2 define, provide fallback for avcodec_free_frame
-rw-r--r-- | image_writer.c | 2 | ||||
-rw-r--r-- | libao2/ao_lavc.c | 2 | ||||
-rw-r--r-- | libav_compat.h | 8 | ||||
-rw-r--r-- | libmpcodecs/ad_ffmpeg.c | 2 | ||||
-rw-r--r-- | libmpcodecs/vd_ffmpeg.c | 2 | ||||
-rw-r--r-- | libvo/vo_lavc.c | 2 |
6 files changed, 12 insertions, 6 deletions
diff --git a/image_writer.c b/image_writer.c index dc7ff96199..877c89e700 100644 --- a/image_writer.c +++ b/image_writer.c @@ -138,7 +138,7 @@ error_exit: if (avctx) avcodec_close(avctx); av_free(avctx); - av_free(pic); + avcodec_free_frame(&pic); free(outbuffer); return success; } diff --git a/libao2/ao_lavc.c b/libao2/ao_lavc.c index 6aab53e291..ef76db2717 100644 --- a/libao2/ao_lavc.c +++ b/libao2/ao_lavc.c @@ -391,7 +391,7 @@ static int encode(struct ao *ao, double apts, void *data) ac->savepts = frame->pts; } - av_free(frame); + avcodec_free_frame(&frame); } else { diff --git a/libav_compat.h b/libav_compat.h index d057f5ea2b..ec6570f0f0 100644 --- a/libav_compat.h +++ b/libav_compat.h @@ -20,9 +20,11 @@ #define MPV_LIBAV_COMPAT_H #include <libavutil/version.h> +#include <libavutil/avutil.h> #include <libavutil/cpu.h> +#include <libavcodec/version.h> -#ifdef AV_CPU_FLAG_MMXEXT +#ifndef AV_CPU_FLAG_MMX2 #define AV_CPU_FLAG_MMX2 AV_CPU_FLAG_MMXEXT #endif @@ -30,4 +32,8 @@ #define AV_CODEC_ID_SUBRIP CODEC_ID_TEXT #endif +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54, 28, 0) +#define avcodec_free_frame av_freep +#endif + #endif /* MPV_LIBAV_COMPAT_H */ diff --git a/libmpcodecs/ad_ffmpeg.c b/libmpcodecs/ad_ffmpeg.c index 1d6683672b..2eacfadb8f 100644 --- a/libmpcodecs/ad_ffmpeg.c +++ b/libmpcodecs/ad_ffmpeg.c @@ -248,7 +248,7 @@ static void uninit(sh_audio_t *sh) av_freep(&lavc_context->extradata); av_freep(&lavc_context); } - av_free(ctx->avframe); + avcodec_free_frame(&ctx->avframe); talloc_free(ctx); sh->context = NULL; } diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index a358dea014..21ecdfaa82 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -365,7 +365,7 @@ static void uninit(sh_video_t *sh) } av_freep(&avctx); - av_freep(&ctx->pic); + avcodec_free_frame(&ctx->pic); talloc_free(ctx); } diff --git a/libvo/vo_lavc.c b/libvo/vo_lavc.c index 96bf32521b..b86cd76509 100644 --- a/libvo/vo_lavc.c +++ b/libvo/vo_lavc.c @@ -436,7 +436,7 @@ static void draw_image(struct vo *vo, mp_image_t *mpi, double pts) ++vc->lastdisplaycount; } - av_free(frame); + avcodec_free_frame(&frame); } if (!mpi) { |