]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/opus.c
avcodec/mpeg12enc: Perform size/level/profile checks earlier
[ffmpeg] / libavcodec / opus.c
index 22cda64801f252139fc4ec6c97d04ce3375d5980..64de246720d8a37ee6d2a0c838433be29759fe1b 100644 (file)
@@ -326,7 +326,9 @@ av_cold int ff_opus_parse_extradata(AVCodecContext *avctx,
         return AVERROR_PATCHWELCOME;
     }
 
-    avctx->delay = avctx->internal->skip_samples = AV_RL16(extradata + 10);
+    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) {
@@ -611,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);