From e8e575633faf19711910cf9caf59f7db300a9ccd Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 11 Dec 2012 18:25:56 +0100 Subject: [PATCH] lavc/utils: Do not require dimensions for PNG. pngenc doesnt need them and mplayer doesnt set them. Signed-off-by: Michael Niedermayer --- libavcodec/utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 0a0c446b8c..5ec99d0f2f 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1000,7 +1000,9 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code } else if (avctx->channel_layout) { avctx->channels = av_get_channel_layout_nb_channels(avctx->channel_layout); } - if(avctx->codec_type == AVMEDIA_TYPE_VIDEO) { + if(avctx->codec_type == AVMEDIA_TYPE_VIDEO && + avctx->codec_id != AV_CODEC_ID_PNG // For mplayer + ) { if (avctx->width <= 0 || avctx->height <= 0) { av_log(avctx, AV_LOG_ERROR, "dimensions not set\n"); ret = AVERROR(EINVAL);