summaryrefslogtreecommitdiff
path: root/libavcodec/libvorbis.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2014-08-23 12:40:50 +0000
committerAnton Khirnov <anton@khirnov.net>2014-10-13 19:09:01 +0000
commit2df0c32ea12ddfa72ba88309812bfb13b674130f (patch)
tree50677fbc787646c10931f8ba95e32883173f7bfb /libavcodec/libvorbis.c
parentc80a816142699dea9cf9fa66689a7838a487ed7e (diff)
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/libvorbis.c')
-rw-r--r--libavcodec/libvorbis.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/libvorbis.c b/libavcodec/libvorbis.c
index 4b4caaac17..07973e6379 100644
--- a/libavcodec/libvorbis.c
+++ b/libavcodec/libvorbis.c
@@ -322,8 +322,8 @@ static int libvorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
if (duration > 0) {
/* we do not know encoder delay until we get the first packet from
* libvorbis, so we have to update the AudioFrameQueue counts */
- if (!avctx->delay) {
- avctx->delay = duration;
+ if (!avctx->initial_padding) {
+ avctx->initial_padding = duration;
s->afq.remaining_delay += duration;
s->afq.remaining_samples += duration;
}