summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-11-17 13:56:34 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-11-17 13:56:34 +0000
commita98091b77bb193224fff698abc7c41102d7ca7c3 (patch)
tree53cc93b4c5c8eb9068eb50f81e37861660006c17 /libmpcodecs
parent69e86099e2c1b661580e27d7b06c5db6bb41da0c (diff)
downloadmpv-a98091b77bb193224fff698abc7c41102d7ca7c3.tar.bz2
mpv-a98091b77bb193224fff698abc7c41102d7ca7c3.tar.xz
Use avcodec_align_dimensions to appropriately align width and height in
get_buffer instead of reimplementing it badly. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29921 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vd_ffmpeg.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
index 33b85dc232..96cec39115 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -536,10 +536,8 @@ static int get_buffer(AVCodecContext *avctx, AVFrame *pic){
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 @@ static int get_buffer(AVCodecContext *avctx, AVFrame *pic){
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: