# HG changeset patch # User michael # Date 1035679071 0 # Node ID 5d1c1d73e8f3d21d9c9b297b6c60f24789638f9c # Parent b1767137b2780f2103671a3c7ee18322d74a5dfc handle direct rendering buffer allocation failure diff -r b1767137b278 -r 5d1c1d73e8f3 libmpcodecs/vd_ffmpeg.c --- a/libmpcodecs/vd_ffmpeg.c Sat Oct 26 16:25:32 2002 +0000 +++ b/libmpcodecs/vd_ffmpeg.c Sun Oct 27 00:37:51 2002 +0000 @@ -54,7 +54,11 @@ #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 @@ } 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 @@ } #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 printf("."); #endif +#if LIBAVCODEC_BUILD >= 4632 + return 0; +#endif } #endif