From 78bdc33b485a96e478aeeea1e9a41d235f241103 Mon Sep 17 00:00:00 2001 From: zuxy Date: Wed, 23 Mar 2011 14:52:13 +0000 Subject: vd_ffmpeg: require aligned stride in get_buffer() Change MP_IMGFLAG_ACCEPT_STRIDE to MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE in get_buffer() as various FFmpeg assembly routines assume aligned input. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33097 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_ffmpeg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libmpcodecs/vd_ffmpeg.c') diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index 2424dda95b..4e3211c412 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -521,7 +521,7 @@ static int get_buffer(AVCodecContext *avctx, AVFrame *pic){ sh_video_t *sh = avctx->opaque; vd_ffmpeg_ctx *ctx = sh->context; mp_image_t *mpi=NULL; - int flags= MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE; + int flags= MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE; int type= MP_IMGTYPE_IPB; int width= avctx->width; int height= avctx->height; -- cgit v1.2.3 From d09882bd74b4a406b4a1e66cf1761d4de67b066b Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 22 Apr 2011 07:58:06 +0000 Subject: vd_ffmpeg: handle reget_buffer in DRI failure fallback code Allow reget_buffer to somewhat work after direct rendering failure. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33286 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_ffmpeg.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libmpcodecs/vd_ffmpeg.c') diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index 4e3211c412..c7f0e429f1 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -559,6 +559,9 @@ static int get_buffer(AVCodecContext *avctx, AVFrame *pic){ if(init_vo(sh, avctx->pix_fmt) < 0){ avctx->release_buffer= avcodec_default_release_buffer; avctx->get_buffer= avcodec_default_get_buffer; + avctx->reget_buffer= avcodec_default_reget_buffer; + if (pic->data[0]) + release_buffer(avctx, pic); return avctx->get_buffer(avctx, pic); } @@ -571,6 +574,9 @@ static int get_buffer(AVCodecContext *avctx, AVFrame *pic){ ctx->do_dr1=0; //FIXME avctx->get_buffer= avcodec_default_get_buffer; + avctx->reget_buffer= avcodec_default_reget_buffer; + if (pic->data[0]) + release_buffer(avctx, pic); return avctx->get_buffer(avctx, pic); } -- cgit v1.2.3 From b977f5960937621f0276ec2d14b6288e95e35c3c Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 22 Apr 2011 08:05:56 +0000 Subject: vd_ffmpeg: Make DR work with reget_buffer without buffer_hints Allow DR to work with reget_buffer when no buffer_hints are set. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33287 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_ffmpeg.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libmpcodecs/vd_ffmpeg.c') diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index c7f0e429f1..a4683e4080 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -525,6 +525,9 @@ static int get_buffer(AVCodecContext *avctx, AVFrame *pic){ int type= MP_IMGTYPE_IPB; int width= avctx->width; int height= avctx->height; + // special case to handle reget_buffer without buffer hints + if (pic->opaque && pic->data[0] && !pic->buffer_hints) + return 0; avcodec_align_dimensions(avctx, &width, &height); //printf("get_buffer %d %d %d\n", pic->reference, ctx->ip_count, ctx->b_count); -- cgit v1.2.3