# HG changeset patch # User reimar # Date 1258466194 0 # Node ID 5dbbcdb2fb47950aa1469af55161d4a8a3a0dc69 # Parent 2b4de99791534e414cb43823c54376bb6516cfc4 Use avcodec_align_dimensions to appropriately align width and height in get_buffer instead of reimplementing it badly. diff -r 2b4de9979153 -r 5dbbcdb2fb47 libmpcodecs/vd_ffmpeg.c --- a/libmpcodecs/vd_ffmpeg.c Mon Nov 16 21:38:32 2009 +0000 +++ b/libmpcodecs/vd_ffmpeg.c Tue Nov 17 13:56:34 2009 +0000 @@ -536,10 +536,8 @@ int type= MP_IMGTYPE_IPB; int width= avctx->width; int height= avctx->height; - int align=15; + avcodec_align_dimensions(avctx, &width, &height); //printf("get_buffer %d %d %d\n", pic->reference, ctx->ip_count, ctx->b_count); - if(avctx->pix_fmt == PIX_FMT_YUV410P) - align=63; //yes seriously, its really needed (16x16 chroma blocks in SVQ1 -> 64x64) if (pic->buffer_hints) { mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "Buffer hints: %u\n", pic->buffer_hints); @@ -595,8 +593,7 @@ mp_msg(MSGT_DECVIDEO, MSGL_DBG2, type== MP_IMGTYPE_IPB ? "using IPB\n" : "using IP\n"); } - mpi= mpcodecs_get_image(sh, type, flags, - (width+align)&(~align), (height+align)&(~align)); + mpi= mpcodecs_get_image(sh, type, flags, width, height); if (!mpi) return -1; // ok, let's see what did we get: