mirror of https://github.com/mpv-player/mpv
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
This commit is contained in:
parent
01a10dd579
commit
f1e637b827
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue