diff mbox series

[FFmpeg-devel] lavc/audiotoolbox: fix build failure on osx 10.5

Message ID 20230711141039.20303-1-pkoshevoy@gmail.com
State New
Headers show
Series [FFmpeg-devel] lavc/audiotoolbox: fix build failure on osx 10.5 | 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

Pavel Koshevoy July 11, 2023, 2:10 p.m. UTC
---
 libavcodec/audiotoolboxdec.c | 2 ++
 libavcodec/audiotoolboxenc.c | 4 ++++
 2 files changed, 6 insertions(+)

Comments

Pavel Koshevoy July 14, 2023, 11:50 p.m. UTC | #1
ping ... could someone review this please

On Tue, Jul 11, 2023 at 8:10 AM Pavel Koshevoy <pkoshevoy@gmail.com> wrote:

> ---
>  libavcodec/audiotoolboxdec.c | 2 ++
>  libavcodec/audiotoolboxenc.c | 4 ++++
>  2 files changed, 6 insertions(+)
>
> diff --git a/libavcodec/audiotoolboxdec.c b/libavcodec/audiotoolboxdec.c
> index 82babe3d31..7b33cdf87d 100644
> --- a/libavcodec/audiotoolboxdec.c
> +++ b/libavcodec/audiotoolboxdec.c
> @@ -71,10 +71,12 @@ static UInt32 ffat_get_format_id(enum AVCodecID codec,
> int profile)
>          return kAudioFormatAMR;
>      case AV_CODEC_ID_EAC3:
>          return kAudioFormatEnhancedAC3;
> +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1058
>      case AV_CODEC_ID_GSM_MS:
>          return kAudioFormatMicrosoftGSM;
>      case AV_CODEC_ID_ILBC:
>          return kAudioFormatiLBC;
> +#endif
>      case AV_CODEC_ID_MP1:
>          return kAudioFormatMPEGLayer1;
>      case AV_CODEC_ID_MP2:
> diff --git a/libavcodec/audiotoolboxenc.c b/libavcodec/audiotoolboxenc.c
> index 1ccfda4d20..f652836018 100644
> --- a/libavcodec/audiotoolboxenc.c
> +++ b/libavcodec/audiotoolboxenc.c
> @@ -69,15 +69,19 @@ static UInt32 ffat_get_format_id(enum AVCodecID codec,
> int profile)
>              return kAudioFormatMPEG4AAC_HE_V2;
>          case FF_PROFILE_AAC_LD:
>              return kAudioFormatMPEG4AAC_LD;
> +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1058
>          case FF_PROFILE_AAC_ELD:
>              return kAudioFormatMPEG4AAC_ELD;
> +#endif
>          }
>      case AV_CODEC_ID_ADPCM_IMA_QT:
>          return kAudioFormatAppleIMA4;
>      case AV_CODEC_ID_ALAC:
>          return kAudioFormatAppleLossless;
> +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1058
>      case AV_CODEC_ID_ILBC:
>          return kAudioFormatiLBC;
> +#endif
>      case AV_CODEC_ID_PCM_ALAW:
>          return kAudioFormatALaw;
>      case AV_CODEC_ID_PCM_MULAW:
> --
> 2.35.3
>
>
James Almer July 15, 2023, 1:34 a.m. UTC | #2
On 7/11/2023 11:10 AM, Pavel Koshevoy wrote:
> ---
>   libavcodec/audiotoolboxdec.c | 2 ++
>   libavcodec/audiotoolboxenc.c | 4 ++++
>   2 files changed, 6 insertions(+)
> 
> diff --git a/libavcodec/audiotoolboxdec.c b/libavcodec/audiotoolboxdec.c
> index 82babe3d31..7b33cdf87d 100644
> --- a/libavcodec/audiotoolboxdec.c
> +++ b/libavcodec/audiotoolboxdec.c
> @@ -71,10 +71,12 @@ static UInt32 ffat_get_format_id(enum AVCodecID codec, int profile)
>           return kAudioFormatAMR;
>       case AV_CODEC_ID_EAC3:
>           return kAudioFormatEnhancedAC3;
> +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1058

Wouldn't it be better to do >= with the actual version where all this is 
first available?

>       case AV_CODEC_ID_GSM_MS:
>           return kAudioFormatMicrosoftGSM;
>       case AV_CODEC_ID_ILBC:
>           return kAudioFormatiLBC;
> +#endif
>       case AV_CODEC_ID_MP1:
>           return kAudioFormatMPEGLayer1;
>       case AV_CODEC_ID_MP2:
> diff --git a/libavcodec/audiotoolboxenc.c b/libavcodec/audiotoolboxenc.c
> index 1ccfda4d20..f652836018 100644
> --- a/libavcodec/audiotoolboxenc.c
> +++ b/libavcodec/audiotoolboxenc.c
> @@ -69,15 +69,19 @@ static UInt32 ffat_get_format_id(enum AVCodecID codec, int profile)
>               return kAudioFormatMPEG4AAC_HE_V2;
>           case FF_PROFILE_AAC_LD:
>               return kAudioFormatMPEG4AAC_LD;
> +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1058
>           case FF_PROFILE_AAC_ELD:
>               return kAudioFormatMPEG4AAC_ELD;
> +#endif
>           }
>       case AV_CODEC_ID_ADPCM_IMA_QT:
>           return kAudioFormatAppleIMA4;
>       case AV_CODEC_ID_ALAC:
>           return kAudioFormatAppleLossless;
> +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1058
>       case AV_CODEC_ID_ILBC:
>           return kAudioFormatiLBC;
> +#endif
>       case AV_CODEC_ID_PCM_ALAW:
>           return kAudioFormatALaw;
>       case AV_CODEC_ID_PCM_MULAW:
Pavel Koshevoy July 15, 2023, 3:42 p.m. UTC | #3
On Fri, Jul 14, 2023 at 7:34 PM James Almer <jamrial@gmail.com> wrote:

> On 7/11/2023 11:10 AM, Pavel Koshevoy wrote:
> > ---
> >   libavcodec/audiotoolboxdec.c | 2 ++
> >   libavcodec/audiotoolboxenc.c | 4 ++++
> >   2 files changed, 6 insertions(+)
> >
> > diff --git a/libavcodec/audiotoolboxdec.c b/libavcodec/audiotoolboxdec.c
> > index 82babe3d31..7b33cdf87d 100644
> > --- a/libavcodec/audiotoolboxdec.c
> > +++ b/libavcodec/audiotoolboxdec.c
> > @@ -71,10 +71,12 @@ static UInt32 ffat_get_format_id(enum AVCodecID
> codec, int profile)
> >           return kAudioFormatAMR;
> >       case AV_CODEC_ID_EAC3:
> >           return kAudioFormatEnhancedAC3;
> > +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1058
>
> Wouldn't it be better to do >= with the actual version where all this is
> first available?
>


I suppose... I've submitted a 2nd version of the patch.

Thank you,
    Pavel.
diff mbox series

Patch

diff --git a/libavcodec/audiotoolboxdec.c b/libavcodec/audiotoolboxdec.c
index 82babe3d31..7b33cdf87d 100644
--- a/libavcodec/audiotoolboxdec.c
+++ b/libavcodec/audiotoolboxdec.c
@@ -71,10 +71,12 @@  static UInt32 ffat_get_format_id(enum AVCodecID codec, int profile)
         return kAudioFormatAMR;
     case AV_CODEC_ID_EAC3:
         return kAudioFormatEnhancedAC3;
+#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1058
     case AV_CODEC_ID_GSM_MS:
         return kAudioFormatMicrosoftGSM;
     case AV_CODEC_ID_ILBC:
         return kAudioFormatiLBC;
+#endif
     case AV_CODEC_ID_MP1:
         return kAudioFormatMPEGLayer1;
     case AV_CODEC_ID_MP2:
diff --git a/libavcodec/audiotoolboxenc.c b/libavcodec/audiotoolboxenc.c
index 1ccfda4d20..f652836018 100644
--- a/libavcodec/audiotoolboxenc.c
+++ b/libavcodec/audiotoolboxenc.c
@@ -69,15 +69,19 @@  static UInt32 ffat_get_format_id(enum AVCodecID codec, int profile)
             return kAudioFormatMPEG4AAC_HE_V2;
         case FF_PROFILE_AAC_LD:
             return kAudioFormatMPEG4AAC_LD;
+#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1058
         case FF_PROFILE_AAC_ELD:
             return kAudioFormatMPEG4AAC_ELD;
+#endif
         }
     case AV_CODEC_ID_ADPCM_IMA_QT:
         return kAudioFormatAppleIMA4;
     case AV_CODEC_ID_ALAC:
         return kAudioFormatAppleLossless;
+#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1058
     case AV_CODEC_ID_ILBC:
         return kAudioFormatiLBC;
+#endif
     case AV_CODEC_ID_PCM_ALAW:
         return kAudioFormatALaw;
     case AV_CODEC_ID_PCM_MULAW: