[FFmpeg-cvslog] avdevice/audiotoolbox: silence warning with new api
xufuji456
git at videolan.org
Mon Dec 11 17:39:54 EET 2023
ffmpeg | branch: master | xufuji456 <839789740 at qq.com> | Sat Dec 9 20:50:59 2023 +0800| [341a483b0868d30d17bf8d5e82facb5e0944a6fe] | committer: Thilo Borgmann
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>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=341a483b0868d30d17bf8d5e82facb5e0944a6fe
---
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);
More information about the ffmpeg-cvslog
mailing list