aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaud Vrac <avrac@freebox.fr>2021-01-05 13:47:43 +0100
committerJames Almer <jamrial@gmail.com>2021-01-09 15:24:32 -0300
commit29993b2947a99806cf41dd58853af510b0ce152c (patch)
tree4c0cd553de553410f0c0c1844a61af497d424594
parenteacad3406e3e772558642d342e87892c3338eb4e (diff)
downloadffmpeg-29993b2947a99806cf41dd58853af510b0ce152c.tar.gz
sbc: do not set sample format in parser
Commit bdd31feec934 changed the SBC decoder to only set the output sample format on init, instead of setting it explicitly on each frame, which is correct. But the SBC parser overrides the sample format to S16, which triggers a crash when combining the parser and the decoder. Fix the issue by not setting the sample format anymore in the parser, which is wrong. Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavcodec/sbc_parser.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/libavcodec/sbc_parser.c b/libavcodec/sbc_parser.c
index f56564147a..5549b1951c 100644
--- a/libavcodec/sbc_parser.c
+++ b/libavcodec/sbc_parser.c
@@ -42,7 +42,6 @@ static int sbc_parse_header(AVCodecParserContext *s, AVCodecContext *avctx,
if (data[0] == MSBC_SYNCWORD && data[1] == 0 && data[2] == 0) {
avctx->channels = 1;
- avctx->sample_fmt = AV_SAMPLE_FMT_S16;
avctx->sample_rate = 16000;
avctx->frame_size = 120;
s->duration = avctx->frame_size;
@@ -66,7 +65,6 @@ static int sbc_parse_header(AVCodecParserContext *s, AVCodecContext *avctx,
+ (joint * subbands)) + 7) / 8;
avctx->channels = channels;
- avctx->sample_fmt = AV_SAMPLE_FMT_S16;
avctx->sample_rate = sample_rates[sr];
avctx->frame_size = subbands * blocks;
s->duration = avctx->frame_size;