]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/rawenc.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavcodec / rawenc.c
index abc650e0ba1a78b38e6adf5c5071c9f2c76f2f70..c6da6b8d8986d795ee65ead4ce77dcc40203d060 100644 (file)
 
 static av_cold int raw_init_encoder(AVCodecContext *avctx)
 {
+    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
+
     avctx->coded_frame            = avctx->priv_data;
     avcodec_get_frame_defaults(avctx->coded_frame);
     avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-    avctx->bits_per_coded_sample = av_get_bits_per_pixel(&av_pix_fmt_descriptors[avctx->pix_fmt]);
+    avctx->bits_per_coded_sample = av_get_bits_per_pixel(desc);
     if(!avctx->codec_tag)
         avctx->codec_tag = avcodec_pix_fmt_to_codec_tag(avctx->pix_fmt);
     return 0;