Add support for more ffmpeg formats

This commit is contained in:
2015-02-02 14:35:36 +00:00
parent a8b66f88ea
commit ff66c4fc2b
+15 -1
View File
@@ -179,13 +179,27 @@ Bool LibAvContextHandle::initAvFormat( char* filename, UInt& width, UInt& height
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;