]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/opus.c
avformat/mpegtsenc: move is_dvb_subtitle/is_dvb_teletext initialization upwards
[ffmpeg] / libavcodec / opus.c
index aa827b604c53340ca84b6ab3edb5943f5329ddba..64de246720d8a37ee6d2a0c838433be29759fe1b 100644 (file)
@@ -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);