Browse Source

rawenc: initialize coded_frame via avcodec_get_frame_defaults.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
tags/n0.11
Reimar Döffinger 13 years ago
parent
commit
97dece333d
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/rawenc.c

+ 1
- 1
libavcodec/rawenc.c View File

@@ -32,8 +32,8 @@
static av_cold int raw_init_encoder(AVCodecContext *avctx) static av_cold int raw_init_encoder(AVCodecContext *avctx)
{ {
avctx->coded_frame = (AVFrame *)avctx->priv_data; avctx->coded_frame = (AVFrame *)avctx->priv_data;
avcodec_get_frame_defaults(avctx->coded_frame);
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I; avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame->key_frame = 1;
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(&av_pix_fmt_descriptors[avctx->pix_fmt]);
if(!avctx->codec_tag) if(!avctx->codec_tag)
avctx->codec_tag = avcodec_pix_fmt_to_codec_tag(avctx->pix_fmt); avctx->codec_tag = avcodec_pix_fmt_to_codec_tag(avctx->pix_fmt);


Loading…
Cancel
Save