diff --git a/multimedia/ffmpeg7/Portfile b/multimedia/ffmpeg7/Portfile index cd413bfc956cb..4250c54927fc5 100644 --- a/multimedia/ffmpeg7/Portfile +++ b/multimedia/ffmpeg7/Portfile @@ -107,6 +107,14 @@ patchfiles-append patch-libavcodec-profvidworkflow.diff # TODO: Raise the issue to upstream patchfiles-append patch-libavcodec-librsvgdec.diff +platform darwin { + # Typedef AVMediaType to NSString* on older systems + # Patch submitted to upstream, remove once upstream has included it + if {${os.major} < 17} { + patchfiles-append patch-libavdevice-avfoundation.diff + } +} + # https://trac.macports.org/ticket/68720 # Remove once upstream has included these in the next release # patchfiles-append patch-issue-10695.diff diff --git a/multimedia/ffmpeg7/files/patch-libavdevice-avfoundation.diff b/multimedia/ffmpeg7/files/patch-libavdevice-avfoundation.diff new file mode 100644 index 0000000000000..d9dec0276725a --- /dev/null +++ b/multimedia/ffmpeg7/files/patch-libavdevice-avfoundation.diff @@ -0,0 +1,14 @@ +--- libavdevice/avfoundation.m ++++ libavdevice/avfoundation.m +@@ -763,6 +763,11 @@ static int get_audio_config(AVFormatContext *s) + return 0; + } + ++#if (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED < 110000) || \ ++ ((!defined(TARGET_OS_OSX) || TARGET_OS_OSX) && __MAC_OS_X_VERSION_MAX_ALLOWED < 101300) ++typedef NSString* AVMediaType; ++#endif ++ + static NSArray* getDevicesWithMediaType(AVMediaType mediaType) { + #if ((TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000) || (TARGET_OS_OSX && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500)) + NSMutableArray *deviceTypes = nil;