From 31f511c9a67632ffff5228a885f1687e024fbee4 Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 27 Oct 2002 00:37:51 +0000 Subject: handle direct rendering buffer allocation failure git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7929 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_ffmpeg.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'libmpcodecs') diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index d0075cac5d..8e9487b542 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -54,7 +54,11 @@ typedef struct { #include "cfgparser.h" +#if LIBAVCODEC_BUILD >= 4632 +static int get_buffer(struct AVCodecContext *avctx, int width, int height, int pict_type); +#else static void get_buffer(struct AVCodecContext *avctx, int width, int height, int pict_type); +#endif #ifdef FF_BUG_AUTODETECT static int lavc_param_workaround_bugs= FF_BUG_AUTODETECT; @@ -231,7 +235,9 @@ static int init(sh_video_t *sh){ } if (sh->bih && (sh->bih->biSize != sizeof(BITMAPINFOHEADER)) && (sh->format == mmioFOURCC('M','4','S','2') || - sh->format == mmioFOURCC('M','P','4','S'))) + sh->format == mmioFOURCC('M','P','4','S') || + sh->format == mmioFOURCC('W','M','V','2') + )) { avctx->extradata_size = sh->bih->biSize-sizeof(BITMAPINFOHEADER); avctx->extradata = malloc(avctx->extradata_size); @@ -373,7 +379,11 @@ static int init_vo(sh_video_t *sh){ } #if LIBAVCODEC_BUILD > 4615 +#if LIBAVCODEC_BUILD >= 4632 +static int get_buffer(struct AVCodecContext *avctx, int width, int height, int pict_type){ +#else static void get_buffer(struct AVCodecContext *avctx, int width, int height, int pict_type){ +#endif sh_video_t * sh = avctx->opaque; vd_ffmpeg_ctx *ctx = sh->context; mp_image_t* mpi=NULL; @@ -456,6 +466,9 @@ else if(mpi->flags&MP_IMGFLAG_DRAW_CALLBACK) else printf("."); #endif +#if LIBAVCODEC_BUILD >= 4632 + return 0; +#endif } #endif -- cgit v1.2.3