From a71051d3cebe7b08f15c27eedc8575821e482dd6 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Mon, 2 Feb 2015 14:35:14 +0000 Subject: [PATCH] Add support for more ffmpeg formats --- lib/LibAvContextHandle.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/LibAvContextHandle.cpp b/lib/LibAvContextHandle.cpp index eeccb71..09c117a 100644 --- a/lib/LibAvContextHandle.cpp +++ b/lib/LibAvContextHandle.cpp @@ -178,13 +178,27 @@ Bool LibAvContextHandle::initAvFormat( const char* filename, UInt& width, UInt& num_frames = 0; } + Int pix_fmt = video_dec_ctx->pix_fmt; + switch( pix_fmt ) + { + case AV_PIX_FMT_YUVJ420P: + pix_fmt = AV_PIX_FMT_YUV420P; + break; + case AV_PIX_FMT_YUVJ422P: + pix_fmt = AV_PIX_FMT_YUV422P; + break; + case AV_PIX_FMT_YUVJ444P: + pix_fmt = AV_PIX_FMT_YUV444P; + break; + } + width = video_dec_ctx->width; height = video_dec_ctx->height; pixel_format = PlaYUVerFrame::NO_FMT; for( Int i = 0; i < PLAYUVER_NUMBER_FORMATS; i++ ) { - if( g_PlaYUVerFramePelFormatsList[i].ffmpegPelFormat == video_dec_ctx->pix_fmt ) + if( g_PlaYUVerFramePelFormatsList[i].ffmpegPelFormat == pix_fmt ) { pixel_format = i; break;