From f1e637b827880fded695789cd9c17a30d958a639 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 6 Nov 2010 21:49:49 +0000 Subject: vd_ffmpeg: compare IMGFMT instead of PIX_FMT Use IMGFMT to compare instead of PIX_FMT to avoid issues with the "JPEG" formats like PIX_FMT_YUVJ422P. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32594 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_ffmpeg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libmpcodecs') diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index 556542f481..0096737fdf 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -138,8 +138,8 @@ static int control(sh_video_t *sh, int cmd, void *arg, ...){ case IMGFMT_IYUV: case IMGFMT_I420: // "converted" using pointer/stride modification - if(avctx->pix_fmt==PIX_FMT_YUV420P) return CONTROL_TRUE;// u/v swap - if(avctx->pix_fmt==PIX_FMT_YUV422P && !ctx->do_dr1) return CONTROL_TRUE;// half stride + if(ctx->best_csp == IMGFMT_YV12) return CONTROL_TRUE;// u/v swap + if(ctx->best_csp == IMGFMT_422P && !ctx->do_dr1) return CONTROL_TRUE;// half stride break; #if CONFIG_XVMC case IMGFMT_XVMC_IDCT_MPEG2: @@ -876,7 +876,7 @@ static struct mp_image *decode(struct sh_video *sh, void *data, int len, if (!mpi->planes[0]) return NULL; - if(avctx->pix_fmt==PIX_FMT_YUV422P && mpi->chroma_y_shift==1){ + if(ctx->best_csp == IMGFMT_422P && mpi->chroma_y_shift==1){ // we have 422p but user wants 420p mpi->stride[1]*=2; mpi->stride[2]*=2; -- cgit v1.2.3