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 A0EB84AAF0 for ; Fri, 12 Jul 2024 17:48:14 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 079E668D983; Fri, 12 Jul 2024 20:48:11 +0300 (EEST) Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BA62F68D983 for ; Fri, 12 Jul 2024 20:48:04 +0300 (EEST) Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-58d24201934so3730938a12.0 for ; Fri, 12 Jul 2024 10:48:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720806484; x=1721411284; darn=ffmpeg.org; h=subject:date:from:to:message-id:from:to:cc:subject:date:message-id :reply-to; bh=akYwvyB9yH2s+YbSeP5wXG/C7+DLf1xUTOt8T8zMUQM=; b=aTUdVyoKGj6FMrx3JDcscFcLEwOYFfoq9V69Ow58N9Cvg83oOTjOzlg1tJjsElRDEd Odw4PpaCBxZiO2+Y5z+C24hoUUJ9+WdJrdBFee8iYALgXEApvqRWCDrJfD67iaEhqS7k 7FUJurVWhp/1n+JhKF6lDX/g4aqkJdGBsOc8jwi77/hXPnmdNXmTDhdUCGghpZFtjbOr CZGbnYONG++BE/+hnvpEMvcPBcsTHqpWzN7oCkH70lMBXA402sBbGdG4xAojBbBDXSBh 8pQyGro934ltCNhqQtz0dTwzjVbhG20NhL2ZC2nL/Pjtqa1aMZ75W7z0I2CgyeQyIeQS K81A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720806484; x=1721411284; h=subject:date:from:to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=akYwvyB9yH2s+YbSeP5wXG/C7+DLf1xUTOt8T8zMUQM=; b=dCH7IHZIcE8fulYNygKF6zsWafbZo5dZQf8kBaGHnCz6flbx+L36lp/GfTFiJmW3w0 +ZqK8MySvVqm5GClIab3fBhXbWOk/1ULi1JK+RV5QaAfiirKQkudntIiDHIdr2nPPJmT iStaY4vPR+hSY6MWF04P4KUNMBTJX4qnN5i0PInjWBxyvAIc5BmDF3Q4kpL0CL7FNFuD Or/1TyYRCDO+UnKpuF0e+qUrDChJT8mdeupUwYckYJQ+t5Vdm2UK3AvK95aKAdXqLVfB EW17Lg/nZlH5pj9yZ2/zVhLvlwazt0h7/UaWa9s4rPnkiv2zHGxF/r+eN06BHVNJMg8J BERQ== X-Gm-Message-State: AOJu0YxcXTTW3ozoGViupVEbfWVXtu4py9cu3wchAkyHkwIr4dtIj9Vw eoEmp/x8SjpOQllXtTlwWe9kmobhbXr818+WEETk2K6H6rtV/NR/d/za+w== X-Google-Smtp-Source: AGHT+IGBhT55P0s2L6st8iKvsQujoSdUqBDOPYDd6NfPNA2ziN+a63y51xtBLD/jG7gt7lNtCR6kfQ== X-Received: by 2002:a50:955a:0:b0:58c:77b4:404b with SMTP id 4fb4d7f45d1cf-59964ac1e02mr2627914a12.15.1720806483572; Fri, 12 Jul 2024 10:48:03 -0700 (PDT) Received: from localhost (p200300cccf1e25001072fbc25e6664b9.dip0.t-ipconnect.de. [2003:cc:cf1e:2500:1072:fbc2:5e66:64b9]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-594bd45a1b6sm4753150a12.60.2024.07.12.10.48.02 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Jul 2024 10:48:03 -0700 (PDT) Message-Id: To: From: "Marvin Scholz" Date: Fri, 12 Jul 2024 17:44:55 +0200 Subject: [FFmpeg-devel] [PATCH 01/11] avdevice/audiotoolbox: fix mixed declaration and code 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 MIME-Version: 1.0 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: Fix a bunch of "mixing declarations and code is incompatible with standards before C99" warnings. --- libavdevice/audiotoolbox.m | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libavdevice/audiotoolbox.m b/libavdevice/audiotoolbox.m index 7d95c34593..dd607589b4 100644 --- a/libavdevice/audiotoolbox.m +++ b/libavdevice/audiotoolbox.m @@ -77,6 +77,9 @@ static av_cold int at_write_header(AVFormatContext *avctx) ATContext *ctx = (ATContext*)avctx->priv_data; OSStatus err = noErr; CFStringRef device_UID = NULL; + const char *stream_name = avctx->url; + AVCodecParameters *codecpar = avctx->streams[0]->codecpar; + AudioStreamBasicDescription device_format = {0}; AudioDeviceID *devices; int num_devices; @@ -133,7 +136,6 @@ static av_cold int at_write_header(AVFormatContext *avctx) // get user-defined device UID or use default device // -audio_device_index overrides any URL given - const char *stream_name = avctx->url; if (stream_name && ctx->audio_device_index == -1) { sscanf(stream_name, "%d", &ctx->audio_device_index); } @@ -163,10 +165,8 @@ static av_cold int at_write_header(AVFormatContext *avctx) } av_freep(&devices); - AVCodecParameters *codecpar = avctx->streams[0]->codecpar; // audio format - AudioStreamBasicDescription device_format = {0}; device_format.mSampleRate = codecpar->sample_rate; device_format.mFormatID = kAudioFormatLinearPCM; device_format.mFormatFlags |= (codecpar->format == AV_SAMPLE_FMT_FLT) ? kLinearPCMFormatFlagIsFloat : 0; @@ -237,6 +237,7 @@ static av_cold int at_write_header(AVFormatContext *avctx) static int at_write_packet(AVFormatContext *avctx, AVPacket *pkt) { + AudioQueueBufferRef buf; ATContext *ctx = (ATContext*)avctx->priv_data; OSStatus err = noErr; @@ -256,7 +257,7 @@ static int at_write_packet(AVFormatContext *avctx, AVPacket *pkt) } } - AudioQueueBufferRef buf = ctx->buffer[ctx->cur_buf]; + buf = ctx->buffer[ctx->cur_buf]; // copy audio data into buffer and enqueue the buffer memcpy(buf->mAudioData, pkt->data, buf->mAudioDataBytesCapacity); base-commit: 85706f5136cf7c88f95843b2634dd3f7d7d2cb6d -- 2.39.3 (Apple Git-146) _______________________________________________ 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".