diff mbox series

[FFmpeg-devel] add WADY demuxer and decoder

Message ID CAPYw7P7otkW-9jgOLwx4CjHtb7Z3xDmDrwpc8YN49CWOrrohYQ@mail.gmail.com
State New
Headers show
Series [FFmpeg-devel] add WADY demuxer and decoder | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Paul B Mahol Jan. 21, 2023, 1:44 p.m. UTC
Hi,

Patches attached.

Comments

Paul B Mahol Jan. 24, 2023, 10:14 a.m. UTC | #1
On 1/21/23, Paul B Mahol <onemda@gmail.com> wrote:
> Hi,
>
> Patches attached.
>

gonna apply
diff mbox series

Patch

From 02f05b5d81597bacc28b9b400f4aa262856a7a2e Mon Sep 17 00:00:00 2001
From: Paul B Mahol <onemda@gmail.com>
Date: Sat, 21 Jan 2023 14:07:48 +0100
Subject: [PATCH 3/3] avcodec/dpcm: add .flush

Otherwise after seek, DC offset for audio samples might be big.

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

diff --git a/libavcodec/dpcm.c b/libavcodec/dpcm.c
index 2420647bc0..86cb9134f8 100644
--- a/libavcodec/dpcm.c
+++ b/libavcodec/dpcm.c
@@ -448,6 +448,13 @@  static int dpcm_decode_frame(AVCodecContext *avctx, AVFrame *frame,
     return avpkt->size;
 }
 
+static void dpcm_flush(AVCodecContext *avctx)
+{
+    DPCMContext *s = avctx->priv_data;
+
+    s->sample[0] = s->sample[1] = 0;
+}
+
 #define DPCM_DECODER(id_, name_, long_name_)                \
 const FFCodec ff_ ## name_ ## _decoder = {                  \
     .p.name         = #name_,                               \
@@ -457,6 +464,7 @@  const FFCodec ff_ ## name_ ## _decoder = {                  \
     .p.capabilities = AV_CODEC_CAP_DR1,                     \
     .priv_data_size = sizeof(DPCMContext),                  \
     .init           = dpcm_decode_init,                     \
+    .flush          = dpcm_flush,                           \
     FF_CODEC_DECODE_CB(dpcm_decode_frame),                  \
 }
 
-- 
2.39.1