diff mbox series

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

Message ID tencent_1EB2D5F20896E3840EB2FF6268185DC0D109@qq.com
State Accepted
Commit 341a483b0868d30d17bf8d5e82facb5e0944a6fe
Headers show
Series [FFmpeg-devel] avdevice/audiotoolbox: silence warning with new api | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

徐福隆 Dec. 9, 2023, 12:50 p.m. UTC
Building with macOS platform, the compiler has a warning: 'kAudioObjectPropertyElementMaster' is deprecated in macOS 12.0

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

Comments

徐福隆 Dec. 11, 2023, 3:28 p.m. UTC | #1
Hi, Thilo:
There is another patch that needs your review please.


Thanks




------------------&nbsp;Original&nbsp;------------------
From:                                                                                                                        "FFmpeg development discussions and patches"                                                                                    <ffmpeg-devel@ffmpeg.org&gt;;
Date:&nbsp;Sat, Dec 9, 2023 08:50 PM
To:&nbsp;"ffmpeg-devel"<ffmpeg-devel@ffmpeg.org&gt;;
Cc:&nbsp;"徐福隆"<839789740@qq.com&gt;;
Subject:&nbsp;[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@qq.com&gt;
---
&nbsp;libavdevice/audiotoolbox.m | 4 ++++
&nbsp;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)
&nbsp;&nbsp;&nbsp;&nbsp; AudioObjectPropertyAddress prop;
&nbsp;&nbsp;&nbsp;&nbsp; prop.mSelector = kAudioHardwarePropertyDevices;
&nbsp;&nbsp;&nbsp;&nbsp; prop.mScope&nbsp;&nbsp;&nbsp; = kAudioObjectPropertyScopeGlobal;
+#if !TARGET_OS_IPHONE &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1200
+&nbsp;&nbsp;&nbsp; prop.mElement&nbsp; = kAudioObjectPropertyElementMain;
+#else
&nbsp;&nbsp;&nbsp;&nbsp; prop.mElement&nbsp; = kAudioObjectPropertyElementMaster;
+#endif
&nbsp;&nbsp;&nbsp;&nbsp; err = AudioObjectGetPropertyDataSize(kAudioObjectSystemObject, &amp;prop, 0, NULL, &amp;data_size);
&nbsp;&nbsp;&nbsp;&nbsp; if (check_status(avctx, &amp;err, "AudioObjectGetPropertyDataSize devices"))
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return AVERROR(EINVAL);
-- 
2.32.0 (Apple Git-132)

_______________________________________________
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".
Thilo Borgmann Dec. 11, 2023, 3:40 p.m. UTC | #2
Am 11.12.23 um 16:28 schrieb 徐福隆 via ffmpeg-devel:
> Hi, Thilo:
> There is another patch that needs your review please.

Thanks for pointing me to it.

> ---
> &nbsp;libavdevice/audiotoolbox.m | 4 ++++
> &nbsp;1 file changed, 4 insertions(+)

LGTM & pushed.

Thanks,
Thilo
diff mbox series

Patch

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);