Skip to content

Commit

Permalink
ffmpeg7: fix compilation for OS X 10.7 through 10.12
Browse files Browse the repository at this point in the history
Add typedef for AVMediaType when compiling against older SDK versions
that use NSString* directly.

Fixes: https://trac.macports.org/ticket/70519
  • Loading branch information
erikbs committed Oct 3, 2024
1 parent 30ea5eb commit a0955d3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions multimedia/ffmpeg7/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ patchfiles-append patch-libavcodec-profvidworkflow.diff
# TODO: Raise the issue to upstream
patchfiles-append patch-libavcodec-librsvgdec.diff

# Typedef AVMediaType to NSString* on older systems
# Patch submitted to upstream, remove once upstream has included it
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
Expand Down
14 changes: 14 additions & 0 deletions multimedia/ffmpeg7/files/patch-libavdevice-avfoundation.diff
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit a0955d3

Please sign in to comment.