Skip to content

Commit

Permalink
ffmpeg-devel: fix compilation for OS X 10.7 through 10.12
Browse files Browse the repository at this point in the history
Co-authored-by: Erik Solem <[email protected]>
  • Loading branch information
aeiouaeiouaeiouaeiouaeiouaeiou and erikbs committed Nov 27, 2024
1 parent 43d7c15 commit 4da8f4f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions multimedia/ffmpeg-devel/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ patchfiles-append patch-libavcodec-librsvgdec.diff
# so the FFMpeg team does not seem to care to include this functionality
patchfiles-append patch-add-pixeldensity.diff

# Typedef AVMediaType to NSString* on older systems
# Patch submitted to upstream, remove once upstream has included it
if {${os.platform} eq "darwin" && ${os.major} < 17} {
patchfiles-append patch-libavdevice-avfoundation.diff
}

# enable auto configure of asm optimizations
# requires Xcode 3.1 or better on Leopard
minimum_xcodeversions {9 3.1}
Expand Down
14 changes: 14 additions & 0 deletions multimedia/ffmpeg-devel/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 4da8f4f

Please sign in to comment.