# HG changeset patch # User jai_menon # Date 1262927282 0 # Node ID 55a1d93c534ca4938a4ba7d2b3b4ccd8a31a9d69 # Parent c03a8c6c755b16c2fc416249253f9f11e858f962 Set bits_per_coded_sample in the raw video encoder. Aside from being the correct thing to do, this also fixes issue 1299. diff -r c03a8c6c755b -r 55a1d93c534c rawenc.c --- a/rawenc.c Fri Jan 08 04:00:06 2010 +0000 +++ b/rawenc.c Fri Jan 08 05:08:02 2010 +0000 @@ -26,6 +26,7 @@ #include "avcodec.h" #include "raw.h" +#include "libavutil/pixdesc.h" #include "libavutil/intreadwrite.h" static av_cold int raw_init_encoder(AVCodecContext *avctx) @@ -33,6 +34,7 @@ avctx->coded_frame = (AVFrame *)avctx->priv_data; avctx->coded_frame->pict_type = FF_I_TYPE; avctx->coded_frame->key_frame = 1; + avctx->bits_per_coded_sample = av_get_bits_per_pixel(&av_pix_fmt_descriptors[avctx->pix_fmt]); if(!avctx->codec_tag) avctx->codec_tag = avcodec_pix_fmt_to_codec_tag(avctx->pix_fmt); return 0;