From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id E624C4364E for ; Wed, 20 Jul 2022 14:50:06 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8005268B630; Wed, 20 Jul 2022 17:50:03 +0300 (EEST) Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4858068B5E6 for ; Wed, 20 Jul 2022 17:49:57 +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: Thu, 21 Jul 2022 00:49:34 +1000 Message-Id: <20220720144937.93133-1-zane@zanevaniperen.com> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: cadance.vs49688.net Subject: [FFmpeg-devel] [PATCH v2 1/4] 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Signed-off-by: Zane van Iperen --- libavformat/argo_cvg.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/libavformat/argo_cvg.c b/libavformat/argo_cvg.c index f32487023a..be78091f0c 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,14 @@ 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); if ((ret = argo_cvg_read_checksum(s->pb, &ctx->header, &ctx->checksum)) < 0) return ret; @@ -172,10 +171,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; -- 2.36.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".