summaryrefslogtreecommitdiff
path: root/libavcodec/amrwbdec.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <ceffmpeg@gmail.com>2019-01-29 22:46:37 +0100
committerCarl Eugen Hoyos <ceffmpeg@gmail.com>2020-04-05 01:55:34 +0200
commitbef3c14dd1a9a38d996497da7ea416aa372283bf (patch)
tree92e472ff9d0a4ae67bda07401314906d1a20e66a /libavcodec/amrwbdec.c
parent56f59246293de417d27ea7e27cb9a7727ee579fb (diff)
downloadffmpeg-bef3c14dd1a9a38d996497da7ea416aa372283bf.tar.gz
lavc/amrwbdec: Do not ignore NO_DATA frames.
Fixes the actual output duration of the sample in ticket #7113.
Diffstat (limited to 'libavcodec/amrwbdec.c')
-rw-r--r--libavcodec/amrwbdec.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c
index 47fe7eb55e..b488a5d3c7 100644
--- a/libavcodec/amrwbdec.c
+++ b/libavcodec/amrwbdec.c
@@ -1119,12 +1119,19 @@ static int amrwb_decode_frame(AVCodecContext *avctx, void *data,
buf_out = (float *)frame->data[0];
header_size = decode_mime_header(ctx, buf);
+ expected_fr_size = ((cf_sizes_wb[ctx->fr_cur_mode] + 7) >> 3) + 1;
+
+ if (ctx->fr_cur_mode == NO_DATA) {
+ for (i = 0; i < frame->nb_samples; i++)
+ buf_out[i] = 0.f;
+ *got_frame_ptr = 1;
+ return expected_fr_size;
+ }
if (ctx->fr_cur_mode > MODE_SID) {
av_log(avctx, AV_LOG_ERROR,
"Invalid mode %d\n", ctx->fr_cur_mode);
return AVERROR_INVALIDDATA;
}
- expected_fr_size = ((cf_sizes_wb[ctx->fr_cur_mode] + 7) >> 3) + 1;
if (buf_size < expected_fr_size) {
av_log(avctx, AV_LOG_ERROR,