summaryrefslogtreecommitdiff
path: root/libavcodec/sbcdec.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-01-29 17:52:21 +0100
committerAnton Khirnov <anton@khirnov.net>2020-03-20 09:16:05 +0100
commitbdd31feec934bad07f5035250f9cb1ec5b571062 (patch)
tree5610d2bb691516c02008d33e13a5dfc5cd7f4757 /libavcodec/sbcdec.c
parent1ec86be79b11ec238067d099d424dd6ee48c8de7 (diff)
downloadffmpeg-bdd31feec934bad07f5035250f9cb1ec5b571062.tar.gz
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().
Diffstat (limited to 'libavcodec/sbcdec.c')
-rw-r--r--libavcodec/sbcdec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/sbcdec.c b/libavcodec/sbcdec.c
index d8ea6855fe..2ebde46627 100644
--- a/libavcodec/sbcdec.c
+++ b/libavcodec/sbcdec.c
@@ -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;