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 ESMTPS id 3C1EA4BD56 for ; Mon, 3 Feb 2025 04:25:42 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 65D8168C2C4; Mon, 3 Feb 2025 06:25:30 +0200 (EET) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0A71A68B9C1 for ; Mon, 3 Feb 2025 06:25:24 +0200 (EET) Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-215770613dbso50542075ad.2 for ; Sun, 02 Feb 2025 20:25:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738556722; x=1739161522; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=wRe7M6CG+Ph+Zh5foEfAWvbqThaDD8Tp2QWfSegaQkE=; b=VXumXvh8D/RkSayOjxZOr1uPbuHlWE4P/v1M6vxF8aPB68avs7ohOiIDww3KoKRuA3 OjGLMSGJIvta3gz9XxOZldZjl1ZA51Yf8Zlat7VkanW0QjoV8yH+VS0WHYFG2xGXOaka EW2JgnAXiLU/SiPWFxFE7JT/et2TxKSYPN7RKaMeHsvMU2ARqlgLqokOMsqJFlVHxdft WiOykUIGylnzHXoUOekA6pKv71u1JQn3yNKG6iXL+A5JSaf1Kw+K3x6g4RE1L+7H/x3U 06rlmPns+HZ8JYo4gb6XZPR0rexEmJf62xdVd4QKBWHcS9om2WAE+sOH2Nx/rLyM4kOf SueA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738556722; x=1739161522; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wRe7M6CG+Ph+Zh5foEfAWvbqThaDD8Tp2QWfSegaQkE=; b=xUsQo8Vaso7PMJoRnIUakqy21fGbTV92FOW3f3jWUEowu/JJ8ujwGD9nL6ZwrlBOM5 q7NuvT0oTCmIaAeWx8gZZrcN4S6KS4AxLIQcw0ruEWqKaamEgPgbHhcLwJAf2GDd0ULS ZUHe0/zd/D22oYOMh8uF4+zm4+VHQCIQwW/cMrL0amCwJ7BKtKMB3tHp32EPl1DOV+MD u+Um7RHTxK7lppidW98mGNJDoIaBWYrER6aAN+Y+DPegn7ULdwQiiOnrurJoj0i4i1vN E4/1mQyPRHUZNlFNCpkM0ZF9TKMu2QzJglfhFi9vL41w3ArincMdk/EpDLWHhrlue3KC Sfng== X-Gm-Message-State: AOJu0YypvYfmGZ4119jETbdjpVGaqDWDjqdtjCBl8G46k7MN9X1toGWD C8IcApPovxnxISLhRAq4fJmbampOPGSPFTLs39LZby0rFXrYSmSRA4KiJw== X-Gm-Gg: ASbGncsrjHYerfOQnTQmMlC0h2aHopRtOc8Bf4GCymYd5fbbkkr/PrdiQj5zxhh6Aki 6a3XYzp03AwwLdtJfq/ag4HbkUoyHGenecwzCIIMjaYBdFEmlZEBuLRwf/fO3A92rRCGRGAp4me ja1D1BZu/1luJXmScjTgIalC0sJca2Tcz5x+0rGbFicQc9y9VOuS0skPRvnmpebyfUppDzGs4Vm XysuSiwlYvoAMRjKOX9YbGOKpPPEx5/2tVYb6PgFh/LlaWxFp5V7e+GVL/BSFBJWU8pF8XbJSVZ /TD/IKM2rsi35hwg78aJTH0RIXkqa/9Zg1pXNyUeow== X-Google-Smtp-Source: AGHT+IEiJly3ooKY/yXRZ0RjJoTpAZUSOL9BLsTWiJ092TVVQfVlDQpx4HAhELRH/jZ1r/xMIH8ECg== X-Received: by 2002:a05:6a21:8dc3:b0:1e8:a374:ced7 with SMTP id adf61e73a8af0-1ed7a538709mr33941129637.23.1738556721885; Sun, 02 Feb 2025 20:25:21 -0800 (PST) Received: from debian.login.wijungle.com ([117.250.157.211]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-acebe3845e6sm6903851a12.22.2025.02.02.20.25.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Feb 2025 20:25:21 -0800 (PST) From: Viraaj Raulgaonkar To: ffmpeg-devel@ffmpeg.org Date: Mon, 3 Feb 2025 09:54:57 +0530 Message-Id: <20250203042458.1863121-1-viraajraulgkar@gmail.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v5 1/2] avformat/riffdec: change declaration of ff_get_wav_header() 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 Cc: Viraaj Raulgaonkar 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: Change the type of logctx from void* to AVFormatContext*. This is in preparation for the next commit. --- libavformat/riff.h | 2 +- libavformat/riffdec.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libavformat/riff.h b/libavformat/riff.h index a93eadfeca..0b01b1fd20 100644 --- a/libavformat/riff.h +++ b/libavformat/riff.h @@ -67,7 +67,7 @@ void ff_put_bmp_header(AVIOContext *pb, AVCodecParameters *par, int for_asf, int int ff_put_wav_header(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par, int flags); enum AVCodecID ff_wav_codec_get_id(unsigned int tag, int bps); -int ff_get_wav_header(void *logctx, AVIOContext *pb, AVCodecParameters *par, +int ff_get_wav_header(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par, int size, int big_endian); extern const AVCodecTag ff_codec_bmp_tags[]; // exposed through avformat_get_riff_video_tags() diff --git a/libavformat/riffdec.c b/libavformat/riffdec.c index b7a85a6ab2..2b269b1682 100644 --- a/libavformat/riffdec.c +++ b/libavformat/riffdec.c @@ -92,14 +92,14 @@ static void parse_waveformatex(void *logctx, AVIOContext *pb, AVCodecParameters } /* "big_endian" values are needed for RIFX file format */ -int ff_get_wav_header(void *logctx, AVIOContext *pb, +int ff_get_wav_header(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par, int size, int big_endian) { int id, channels = 0, ret; uint64_t bitrate = 0; if (size < 14) { - avpriv_request_sample(logctx, "wav header size < 14"); + avpriv_request_sample(s, "wav header size < 14"); return AVERROR_INVALIDDATA; } @@ -140,18 +140,18 @@ int ff_get_wav_header(void *logctx, AVIOContext *pb, if (size >= 18 && id != 0x0165) { /* We're obviously dealing with WAVEFORMATEX */ int cbSize = avio_rl16(pb); /* cbSize */ if (big_endian) { - avpriv_report_missing_feature(logctx, "WAVEFORMATEX support for RIFX files"); + avpriv_report_missing_feature(s, "WAVEFORMATEX support for RIFX files"); return AVERROR_PATCHWELCOME; } size -= 18; cbSize = FFMIN(size, cbSize); if (cbSize >= 22 && id == 0xfffe) { /* WAVEFORMATEXTENSIBLE */ - parse_waveformatex(logctx, pb, par); + parse_waveformatex(s, pb, par); cbSize -= 22; size -= 22; } if (cbSize > 0) { - ret = ff_get_extradata(logctx, par, pb, cbSize); + ret = ff_get_extradata(s, par, pb, cbSize); if (ret < 0) return ret; size -= cbSize; @@ -164,7 +164,7 @@ int ff_get_wav_header(void *logctx, AVIOContext *pb, int nb_streams, i; size -= 4; - ret = ff_get_extradata(logctx, par, pb, size); + ret = ff_get_extradata(s, par, pb, size); if (ret < 0) return ret; nb_streams = AV_RL16(par->extradata + 4); @@ -180,7 +180,7 @@ int ff_get_wav_header(void *logctx, AVIOContext *pb, par->bit_rate = bitrate; if (par->sample_rate <= 0) { - av_log(logctx, AV_LOG_ERROR, + av_log(s, AV_LOG_ERROR, "Invalid sample rate: %d\n", par->sample_rate); return AVERROR_INVALIDDATA; } -- 2.39.5 _______________________________________________ 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".