diff options
author | Anton Khirnov <anton@khirnov.net> | 2014-08-23 12:40:50 +0000 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2014-10-13 19:09:01 +0000 |
commit | 2df0c32ea12ddfa72ba88309812bfb13b674130f (patch) | |
tree | 50677fbc787646c10931f8ba95e32883173f7bfb /libavcodec/libopencore-amr.c | |
parent | c80a816142699dea9cf9fa66689a7838a487ed7e (diff) | |
download | ffmpeg-2df0c32ea12ddfa72ba88309812bfb13b674130f.tar.gz |
lavc: use a separate field for exporting audio encoder padding
Currently, the amount of padding inserted at the beginning by some audio
encoders, is exported through AVCodecContext.delay. However
- the term 'delay' is heavily overloaded and can have multiple different
meanings even in the case of audio encoding.
- this field has entirely different meanings, depending on whether the
codec context is used for encoding or decoding (and has yet another
different meaning for video), preventing generic handling of the codec
context.
Therefore, add a new field -- AVCodecContext.initial_padding. It could
conceivably be used for decoding as well at a later point.
Diffstat (limited to 'libavcodec/libopencore-amr.c')
-rw-r--r-- | libavcodec/libopencore-amr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c index 6b459590d7..0704e94b47 100644 --- a/libavcodec/libopencore-amr.c +++ b/libavcodec/libopencore-amr.c @@ -200,7 +200,7 @@ static av_cold int amr_nb_encode_init(AVCodecContext *avctx) } avctx->frame_size = 160; - avctx->delay = 50; + avctx->initial_padding = 50; ff_af_queue_init(avctx, &s->afq); s->enc_state = Encoder_Interface_init(s->enc_dtx); @@ -250,7 +250,7 @@ static int amr_nb_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, return AVERROR(ENOMEM); memcpy(flush_buf, samples, frame->nb_samples * sizeof(*flush_buf)); samples = flush_buf; - if (frame->nb_samples < avctx->frame_size - avctx->delay) + if (frame->nb_samples < avctx->frame_size - avctx->initial_padding) s->enc_last_frame = -1; } if ((ret = ff_af_queue_add(&s->afq, frame)) < 0) { |