[PATCH 1/2] Make rawdec.c honor the pixel format if specified in the codec context.

Stefano Sabatini stefano.sabatini-lala
Mon Mar 22 22:42:42 CET 2010


---
 libavcodec/rawdec.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index b4c7b3c..5bf0e19 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -72,12 +72,14 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
 {
     RawVideoContext *context = avctx->priv_data;
 
+    if (avctx->pix_fmt == PIX_FMT_NONE) {
     if (avctx->codec_tag == MKTAG('r','a','w',' '))
         avctx->pix_fmt = findPixelFormat(pixelFormatBpsMOV, avctx->bits_per_coded_sample);
     else if (avctx->codec_tag)
         avctx->pix_fmt = findPixelFormat(ff_raw_pixelFormatTags, avctx->codec_tag);
     else if (avctx->bits_per_coded_sample)
         avctx->pix_fmt = findPixelFormat(pixelFormatBpsAVI, avctx->bits_per_coded_sample);
+    }
 
     context->length = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
     context->buffer = av_malloc(context->length);
-- 
1.7.0


--fUYQa+Pmc3FrFX/N--



More information about the ffmpeg-devel mailing list