aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorJai Menon <jmenon86@gmail.com>2010-01-08 05:08:02 +0000
committerJai Menon <jmenon86@gmail.com>2010-01-08 05:08:02 +0000
commit8456462fb86e3bbc6ebc157153d75a1aca1d84ad (patch)
treecab8ea4008c6c5499eff49740cbffbdc02c98ca1 /libavcodec
parent51ce2207c8fd3ee72d74e0a559962beaa895c234 (diff)
downloadffmpeg-8456462fb86e3bbc6ebc157153d75a1aca1d84ad.tar.gz
Set bits_per_coded_sample in the raw video encoder.
Aside from being the correct thing to do, this also fixes issue 1299. Originally committed as revision 21083 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/rawenc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/rawenc.c b/libavcodec/rawenc.c
index 82a543ad46..b7924a97ac 100644
--- a/libavcodec/rawenc.c
+++ b/libavcodec/rawenc.c
@@ -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 @@ static av_cold int raw_init_encoder(AVCodecContext *avctx)
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;