1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

lavc/utils: Do not require dimensions for PNG.

pngenc doesnt need them and mplayer doesnt set them.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-12-11 18:25:56 +01:00
parent bbc8f0cd9b
commit e8e575633f

View File

@ -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);