From patchwork Sun Jul 17 13:31:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zane van Iperen X-Patchwork-Id: 36808 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1649:b0:8b:613a:194d with SMTP id no9csp565537pzb; Sun, 17 Jul 2022 06:32:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vRTRmziViixlmXkKOBDzn1xMW2cuK8sSZvliZLVDYgCpg2gF9vq/Omb5X3m2XiI1yBzedA X-Received: by 2002:a17:907:1c95:b0:72b:4e37:7736 with SMTP id nb21-20020a1709071c9500b0072b4e377736mr21985512ejc.516.1658064730610; Sun, 17 Jul 2022 06:32:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658064730; cv=none; d=google.com; s=arc-20160816; b=DnYWrKzuZr5yjCoA8pW0fRUC/MM/ilKsLeCQZHW4cNPBxNAaf3dXXtXTxFDF94zAYd 6xAC0kjP0IxL4l2dXG+qONOqB9RSlLpW0XVVCsqUIaLxUHBbFdFMRy0p7LxzpgXUEqdb gTqu4H5R8oeOsk+49TBZQoE2R46EyA4ZpqPhBagPhFYqG210p8xXi3plchz0FUZ+eRtn 9V0AlR1SYp8dKeGvfiqrER1bxON1Rc80RblfrJVyt8VsQPmYLz/0z1g35oemGWdT0kmO L51R5zwgkJ5s+FzVuX+2uV3GRTPzTeO90Xm2KBK1NuOC9S9NB5Tu2BBIxLP19DYkcijQ BIWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=pyrYRzvibO9mhHjPMopUD+7ClOoMtxOn3Ux8kqZFWok=; b=nLiZM3FDuoRVAwIMDXQq8b+3JPu1aeWx483oDWaGbFoU2uFtSPwpevHOZboLYh++fQ uN1V4S0bZupzPlpnt1t9uk0j123yWZQGWTPCCCcxQZT+ZVKNwxDSGJoRk+jDjrDD5ZFW FgPEC+8gzI7OlyBrMZ/7aw8CbkCmLHhItXVwX2LZksvlcu5c4x7q/a93HmejP5Q+tfIk h+G/A+QG3yb+tHdrxB2PK1E3NE3Tu2m6nkan4igcdNcDnhjagUFJBSU1iPFohBXVW67/ Z/q58Ee5olkLMwIE6fnmWyLtzIFuBUOfnza/ykBQDnkrvmYoQRrACfChP1xSPm62Atj5 EYyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zanevaniperen.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id zc12-20020a170906988c00b007269e670e4asi10525364ejb.912.2022.07.17.06.32.09; Sun, 17 Jul 2022 06:32:10 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zanevaniperen.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 14B2168B856; Sun, 17 Jul 2022 16:32:06 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9DBB968B697 for ; Sun, 17 Jul 2022 16:31:58 +0300 (EEST) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Zane van Iperen To: ffmpeg-devel@ffmpeg.org Date: Sun, 17 Jul 2022 23:31:42 +1000 Message-Id: <20220717133143.881124-1-zane@zanevaniperen.com> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: cadance.vs49688.net Subject: [FFmpeg-devel] [PATCH 1/2] avformat/argo_cvg: name unk{1, 2} fields correctly X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: u3cvueWroqWu Signed-off-by: Zane van Iperen --- libavformat/argo_cvg.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/libavformat/argo_cvg.c b/libavformat/argo_cvg.c index f32487023a..2ee4a64449 100644 --- a/libavformat/argo_cvg.c +++ b/libavformat/argo_cvg.c @@ -40,9 +40,9 @@ #define ARGO_CVG_SAMPLES_PER_BLOCK 28 typedef struct ArgoCVGHeader { - uint32_t size; /*< File size -8 (this + trailing checksum) */ - uint32_t unk1; /*< Unknown. Always seems to be 0 or 1. */ - uint32_t unk2; /*< Unknown. Always seems to be 0 or 1. */ + uint32_t size; /*< File size -8 (this + trailing checksum) */ + uint32_t loop; /*< Loop flag. */ + uint32_t reverb; /*< Reverb flag. */ } ArgoCVGHeader; typedef struct ArgoCVGOverride { @@ -91,17 +91,17 @@ static int argo_cvg_probe(const AVProbeData *p) if (p->buf_size < ARGO_CVG_HEADER_SIZE) return 0; - cvg.size = AV_RL32(p->buf + 0); - cvg.unk1 = AV_RL32(p->buf + 4); - cvg.unk2 = AV_RL32(p->buf + 8); + cvg.size = AV_RL32(p->buf + 0); + cvg.loop = AV_RL32(p->buf + 4); + cvg.reverb = AV_RL32(p->buf + 8); if (cvg.size < 8) return 0; - if (cvg.unk1 != 0 && cvg.unk1 != 1) + if (cvg.loop != 0 && cvg.loop != 1) return 0; - if (cvg.unk2 != 0 && cvg.unk2 != 1) + if (cvg.reverb != 0 && cvg.reverb != 1) return 0; return AVPROBE_SCORE_MAX / 4 + 1; @@ -150,15 +150,16 @@ static int argo_cvg_read_header(AVFormatContext *s) else if (ret != ARGO_CVG_HEADER_SIZE) return AVERROR(EIO); - ctx->header.size = AV_RL32(buf + 0); - ctx->header.unk1 = AV_RL32(buf + 4); - ctx->header.unk2 = AV_RL32(buf + 8); + ctx->header.size = AV_RL32(buf + 0); + ctx->header.loop = AV_RL32(buf + 4); + ctx->header.reverb = AV_RL32(buf + 8); if (ctx->header.size < 8) return AVERROR_INVALIDDATA; av_log(s, AV_LOG_TRACE, "size = %u\n", ctx->header.size); - av_log(s, AV_LOG_TRACE, "unk = %u, %u\n", ctx->header.unk1, ctx->header.unk2); + av_log(s, AV_LOG_TRACE, "loop = %u\n", ctx->header.loop); + av_log(s, AV_LOG_TRACE, "reverb = %u\n", ctx->header.reverb); if ((ret = argo_cvg_read_checksum(s->pb, &ctx->header, &ctx->checksum)) < 0) return ret; @@ -172,10 +173,10 @@ static int argo_cvg_read_header(AVFormatContext *s) for (size_t i = 0; i < FF_ARRAY_ELEMS(overrides); i++) { const ArgoCVGOverride *ovr = overrides + i; - if (ovr->header.size != ctx->header.size || - ovr->header.unk1 != ctx->header.unk1 || - ovr->header.unk2 != ctx->header.unk2 || - ovr->checksum != ctx->checksum || + if (ovr->header.size != ctx->header.size || + ovr->header.loop != ctx->header.loop || + ovr->header.reverb != ctx->header.reverb || + ovr->checksum != ctx->checksum || av_strcasecmp(filename, ovr->name) != 0) continue;