# HG changeset patch # User reimar # Date 1289080189 0 # Node ID 97738e6f82dc917962e622d6abf884594db55a5a # Parent 85dd2718c84a795fc552e6621d700dfc1115ceef Use IMGFMT to compare instead of PIX_FMT to avoid issues with the "JPEG" formats like PIX_FMT_YUVJ422P. diff -r 85dd2718c84a -r 97738e6f82dc libmpcodecs/vd_ffmpeg.c --- a/libmpcodecs/vd_ffmpeg.c Sat Nov 06 21:41:12 2010 +0000 +++ b/libmpcodecs/vd_ffmpeg.c Sat Nov 06 21:49:49 2010 +0000 @@ -158,8 +158,8 @@ 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: @@ -948,7 +948,7 @@ 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;