[FFmpeg-devel] [PATCH] avdevice/audiotoolbox: silence warning with new api

徐福隆 839789740 at qq.com
Mon Dec 11 17:28:33 EET 2023


Hi, Thilo:
There is another patch that needs your review please.


Thanks




------------------ Original ------------------
From:                                                                                                                        "FFmpeg development discussions and patches"                                                                                    <ffmpeg-devel at ffmpeg.org>;
Date: Sat, Dec 9, 2023 08:50 PM
To: "ffmpeg-devel"<ffmpeg-devel at ffmpeg.org>;
Cc: "徐福隆"<839789740 at qq.com>;
Subject: [FFmpeg-devel] [PATCH] avdevice/audiotoolbox: silence warning with new api



Building with macOS platform, the compiler has a warning: 'kAudioObjectPropertyElementMaster' is deprecated in macOS 12.0

Signed-off-by: xufuji456 <839789740 at qq.com>
---
 libavdevice/audiotoolbox.m | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavdevice/audiotoolbox.m b/libavdevice/audiotoolbox.m
index aa49e2c992..ae91a2bc62 100644
--- a/libavdevice/audiotoolbox.m
+++ b/libavdevice/audiotoolbox.m
@@ -85,7 +85,11 @@ static av_cold int at_write_header(AVFormatContext *avctx)
     AudioObjectPropertyAddress prop;
     prop.mSelector = kAudioHardwarePropertyDevices;
     prop.mScope    = kAudioObjectPropertyScopeGlobal;
+#if !TARGET_OS_IPHONE && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1200
+    prop.mElement  = kAudioObjectPropertyElementMain;
+#else
     prop.mElement  = kAudioObjectPropertyElementMaster;
+#endif
     err = AudioObjectGetPropertyDataSize(kAudioObjectSystemObject, &prop, 0, NULL, &data_size);
     if (check_status(avctx, &err, "AudioObjectGetPropertyDataSize devices"))
         return AVERROR(EINVAL);
-- 
2.32.0 (Apple Git-132)

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel at ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list