[FFmpeg-devel] avcodec/opus: set skip_samples

Submitted by Paul B Mahol on Nov. 27, 2018, 2:18 p.m.

Details

Message ID 20181127141814.30059-1-onemda@gmail.com
State New
Headers show

Commit Message

Paul B Mahol Nov. 27, 2018, 2:18 p.m.
Fixes #5258.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavcodec/opus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Michael Niedermayer Nov. 28, 2018, 5:27 p.m.
On Tue, Nov 27, 2018 at 03:18:14PM +0100, Paul B Mahol wrote:
> Fixes #5258.
> 
> Signed-off-by: Paul B Mahol <onemda@gmail.com>
> ---
>  libavcodec/opus.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

breaks fate

make: *** [fate-seek-mkv-codec-delay] Error 139
make: *** [fate-opus-tron.6ch.tinypkts] Error 1
make: *** [fate-ts-opus-demux] Error 139


[...]

Patch hide | download patch | download mbox

diff --git a/libavcodec/opus.c b/libavcodec/opus.c
index aa827b604c..22cda64801 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] = {
@@ -325,7 +326,7 @@  av_cold int ff_opus_parse_extradata(AVCodecContext *avctx,
         return AVERROR_PATCHWELCOME;
     }
 
-    avctx->delay = AV_RL16(extradata + 10);
+    avctx->delay = avctx->internal->skip_samples = AV_RL16(extradata + 10);
 
     channels = avctx->extradata ? extradata[9] : (avctx->channels == 1) ? 1 : 2;
     if (!channels) {