X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fopus.c;h=64de246720d8a37ee6d2a0c838433be29759fe1b;hb=bc70684e74a185d7b80c8b80bdedda659cb581b8;hp=aa827b604c53340ca84b6ab3edb5943f5329ddba;hpb=23ce57af3ad684363881cdd66d5724f40963a65c;p=ffmpeg diff --git a/libavcodec/opus.c b/libavcodec/opus.c index aa827b604c5..64de246720d 100644 --- a/libavcodec/opus.c +++ b/libavcodec/opus.c @@ -31,6 +31,7 @@ #include "opus_celt.h" #include "opustab.h" +#include "internal.h" #include "vorbis.h" static const uint16_t opus_frame_duration[32] = { @@ -326,6 +327,8 @@ av_cold int ff_opus_parse_extradata(AVCodecContext *avctx, } avctx->delay = AV_RL16(extradata + 10); + if (avctx->internal) + avctx->internal->skip_samples = avctx->delay; channels = avctx->extradata ? extradata[9] : (avctx->channels == 1) ? 1 : 2; if (!channels) { @@ -610,6 +613,8 @@ void ff_celt_bitalloc(CeltFrame *f, OpusRangeCoder *rc, int encode) } /* Allocation trim */ + if (!encode) + f->alloc_trim = 5; if (opus_rc_tell_frac(rc) + (6 << 3) <= tbits_8ths) if (encode) ff_opus_rc_enc_cdf(rc, f->alloc_trim, ff_celt_model_alloc_trim);