comparison rawdec.c @ 11861:f6a2af58f3e0 libavcodec

avcodec.h: Clarify AVCodecContext::pix_fmt documentation since its value may be set by the demuxer rawdec.c: Only perform bits_per_coded_sample -> pix_fmt guesswork if pix_fmt hasn't been set
author thardin
date Thu, 10 Jun 2010 08:39:05 +0000
parents 33498215b74f
children 46191b10d663
comparison
equal deleted inserted replaced
11860:b39ced9e4fc3 11861:f6a2af58f3e0
75 75
76 if (avctx->codec_tag == MKTAG('r','a','w',' ')) 76 if (avctx->codec_tag == MKTAG('r','a','w',' '))
77 avctx->pix_fmt = find_pix_fmt(pix_fmt_bps_mov, avctx->bits_per_coded_sample); 77 avctx->pix_fmt = find_pix_fmt(pix_fmt_bps_mov, avctx->bits_per_coded_sample);
78 else if (avctx->codec_tag) 78 else if (avctx->codec_tag)
79 avctx->pix_fmt = find_pix_fmt(ff_raw_pix_fmt_tags, avctx->codec_tag); 79 avctx->pix_fmt = find_pix_fmt(ff_raw_pix_fmt_tags, avctx->codec_tag);
80 else if (avctx->bits_per_coded_sample) 80 else if (avctx->pix_fmt == PIX_FMT_NONE && avctx->bits_per_coded_sample)
81 avctx->pix_fmt = find_pix_fmt(pix_fmt_bps_avi, avctx->bits_per_coded_sample); 81 avctx->pix_fmt = find_pix_fmt(pix_fmt_bps_avi, avctx->bits_per_coded_sample);
82 82
83 context->length = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height); 83 context->length = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
84 context->buffer = av_malloc(context->length); 84 context->buffer = av_malloc(context->length);
85 context->pic.pict_type = FF_I_TYPE; 85 context->pic.pict_type = FF_I_TYPE;