Browse Source

sbcdec: do not unnecessarily set frame properties

Decoders are supposed to export stream properties in AVCodecContext, the
AVFrame properties are set from those in ff_get_buffer().
tags/n4.3
Anton Khirnov 5 years ago
parent
commit
bdd31feec9
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      libavcodec/sbcdec.c

+ 4
- 3
libavcodec/sbcdec.c View File

@@ -324,6 +324,8 @@ static int sbc_decode_init(AVCodecContext *avctx)
SBCDecContext *sbc = avctx->priv_data;
int i, ch;

avctx->sample_fmt = AV_SAMPLE_FMT_S16P;

sbc->frame.crc_ctx = av_crc_get_table(AV_CRC_8_EBU);

memset(sbc->dsp.V, 0, sizeof(sbc->dsp.V));
@@ -348,9 +350,8 @@ static int sbc_decode_frame(AVCodecContext *avctx,
if (frame_length <= 0)
return frame_length;

avctx->channels =
frame->channels = sbc->frame.channels;
frame->format = AV_SAMPLE_FMT_S16P;
avctx->channels = sbc->frame.channels;

frame->nb_samples = sbc->frame.blocks * sbc->frame.subbands;
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
return ret;


Loading…
Cancel
Save