0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

libav_compat: fix mmx2 define, provide fallback for avcodec_free_frame

This commit is contained in:
Stefano Pigozzi 2012-11-03 18:06:23 +01:00
parent 6e6fc03828
commit e6a6a60276
6 changed files with 12 additions and 6 deletions

View File

@ -138,7 +138,7 @@ error_exit:
if (avctx) if (avctx)
avcodec_close(avctx); avcodec_close(avctx);
av_free(avctx); av_free(avctx);
av_free(pic); avcodec_free_frame(&pic);
free(outbuffer); free(outbuffer);
return success; return success;
} }

View File

@ -391,7 +391,7 @@ static int encode(struct ao *ao, double apts, void *data)
ac->savepts = frame->pts; ac->savepts = frame->pts;
} }
av_free(frame); avcodec_free_frame(&frame);
} }
else else
{ {

View File

@ -20,9 +20,11 @@
#define MPV_LIBAV_COMPAT_H #define MPV_LIBAV_COMPAT_H
#include <libavutil/version.h> #include <libavutil/version.h>
#include <libavutil/avutil.h>
#include <libavutil/cpu.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 #define AV_CPU_FLAG_MMX2 AV_CPU_FLAG_MMXEXT
#endif #endif
@ -30,4 +32,8 @@
#define AV_CODEC_ID_SUBRIP CODEC_ID_TEXT #define AV_CODEC_ID_SUBRIP CODEC_ID_TEXT
#endif #endif
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54, 28, 0)
#define avcodec_free_frame av_freep
#endif
#endif /* MPV_LIBAV_COMPAT_H */ #endif /* MPV_LIBAV_COMPAT_H */

View File

@ -248,7 +248,7 @@ static void uninit(sh_audio_t *sh)
av_freep(&lavc_context->extradata); av_freep(&lavc_context->extradata);
av_freep(&lavc_context); av_freep(&lavc_context);
} }
av_free(ctx->avframe); avcodec_free_frame(&ctx->avframe);
talloc_free(ctx); talloc_free(ctx);
sh->context = NULL; sh->context = NULL;
} }

View File

@ -365,7 +365,7 @@ static void uninit(sh_video_t *sh)
} }
av_freep(&avctx); av_freep(&avctx);
av_freep(&ctx->pic); avcodec_free_frame(&ctx->pic);
talloc_free(ctx); talloc_free(ctx);
} }

View File

@ -436,7 +436,7 @@ static void draw_image(struct vo *vo, mp_image_t *mpi, double pts)
++vc->lastdisplaycount; ++vc->lastdisplaycount;
} }
av_free(frame); avcodec_free_frame(&frame);
} }
if (!mpi) { if (!mpi) {