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 authored and root committed Aug 23, 2024
1 parent 11c25bb commit 29738ce
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
5 changes: 4 additions & 1 deletion multimedia/ffmpeg7/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ name ffmpeg7
set my_name ffmpeg

version 7.0.1
revision 0
revision 1

license LGPL-2.1+
categories multimedia
Expand Down Expand Up @@ -105,6 +105,9 @@ 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
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
13 changes: 13 additions & 0 deletions multimedia/ffmpeg7/files/patch-libavdevice-avfoundation.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- libavdevice/avfoundation.m
+++ libavdevice/avfoundation.m
@@ -763,6 +763,10 @@ static int get_audio_config(AVFormatContext *s)
return 0;
}

+#if ((TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED < 110000) || (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 29738ce

Please sign in to comment.