From patchwork Tue Mar 23 14:12:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zane van Iperen X-Patchwork-Id: 26564 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id A86C444BC28 for ; Tue, 23 Mar 2021 16:13:47 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9A0D568AB1E; Tue, 23 Mar 2021 16:13:47 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out2.migadu.com (unknown [188.165.223.204]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B26CE68A176 for ; Tue, 23 Mar 2021 16:13:38 +0200 (EET) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zanevaniperen.com; s=key1; t=1616508811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3+4wjagbOBqEW4G4YRPS8kckN1JRZ5h5Vv2Q49YCRsI=; b=KkVoHep8Wj0ROdZR3e1DWxzvE4Zqw0JZaVxBgulOtbUl0ZdQJtL/TuVsITgmRMPaxaZV/c B1tm0xqDkUW9HGVY5tZFVKn1J8G4jS+TcrjXqZZSJgij2BZt0r8tNaoKi+YmT7d4/69qIW poYytYf0gaTbpzaOz4no9nS6ArqeqTHRhY7M1aYlF6rpNMEBWZVZsOXXHrnIgg7+9Q4PlT C5V5rTKOgl+TZhEXvkwZ3r4QB59ijM2jC9AIlbA++J2xJ7Qw5okiX+JsmlOj6mP2jK0/xm 0D+V1BTfGtGYVd3ftpor8u9zBb7hesPaeM4rtHDzLbb06IYXplckXJZHl87QDw== From: Zane van Iperen To: ffmpeg-devel@ffmpeg.org Date: Wed, 24 Mar 2021 00:12:57 +1000 Message-Id: <20210323141305.19229-3-zane@zanevaniperen.com> In-Reply-To: <20210323141305.19229-1-zane@zanevaniperen.com> References: <20210323141305.19229-1-zane@zanevaniperen.com> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: git-morningstar@zanevaniperen.com Subject: [FFmpeg-devel] [PATCH 03/11] avcodec/adpcm_aica: reset state in flush callback X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Zane van Iperen Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Zane van Iperen --- libavcodec/adpcm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index b145622f4f..b035406550 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -1811,11 +1811,6 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data, } break; case AV_CODEC_ID_ADPCM_AICA: - if (!c->has_status) { - for (channel = 0; channel < avctx->channels; channel++) - c->status[channel].step = 0; - c->has_status = 1; - } for (channel = 0; channel < avctx->channels; channel++) { samples = samples_p[channel]; for (n = nb_samples >> 1; n > 0; n--) { @@ -2116,6 +2111,11 @@ static void adpcm_flush(AVCodecContext *avctx) ADPCMDecodeContext *c = avctx->priv_data; switch(avctx->codec_id) { + case AV_CODEC_ID_ADPCM_AICA: + for (int channel = 0; channel < avctx->channels; channel++) + c->status[channel].step = 0; + break; + case AV_CODEC_ID_ADPCM_ZORK: for (int channel = 0; channel < avctx->channels; channel++) { c->status[channel].predictor = 0;