comparison libmpcodecs/vd_ffmpeg.c @ 36143:3c1595fcf004

Update calculation of allocation size for direct rendering.
author reimar
date Sun, 05 May 2013 07:27:33 +0000
parents 1cfb48d5243f
children f69d9caa3d84
comparison
equal deleted inserted replaced
36142:1cfb48d5243f 36143:3c1595fcf004
550 sh_video_t *sh = avctx->opaque; 550 sh_video_t *sh = avctx->opaque;
551 vd_ffmpeg_ctx *ctx = sh->context; 551 vd_ffmpeg_ctx *ctx = sh->context;
552 mp_image_t *mpi=NULL; 552 mp_image_t *mpi=NULL;
553 int flags= MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE; 553 int flags= MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE;
554 int type= MP_IMGTYPE_IPB; 554 int type= MP_IMGTYPE_IPB;
555 int width= avctx->width; 555 int width = FFMAX(avctx->width, -(-avctx->coded_width >> avctx->lowres));
556 int height= avctx->height; 556 int height= FFMAX(avctx->height, -(-avctx->coded_height >> avctx->lowres));
557 // special case to handle reget_buffer 557 // special case to handle reget_buffer
558 if (pic->opaque && pic->data[0] && (!pic->buffer_hints || pic->buffer_hints & FF_BUFFER_HINTS_REUSABLE)) 558 if (pic->opaque && pic->data[0] && (!pic->buffer_hints || pic->buffer_hints & FF_BUFFER_HINTS_REUSABLE))
559 return 0; 559 return 0;
560 avcodec_align_dimensions(avctx, &width, &height); 560 avcodec_align_dimensions(avctx, &width, &height);
561 //printf("get_buffer %d %d %d\n", pic->reference, ctx->ip_count, ctx->b_count); 561 //printf("get_buffer %d %d %d\n", pic->reference, ctx->ip_count, ctx->b_count);