Skip to content

Commit 69bab4e

Browse files
committed
avfoundation: Fix compilation for OSes other than macOS and iOS
E.g. tvOS doesn't have devicesWithMediaType. In principle, we could probably disable building the whole input device on such OSes, but that would either require testing explicitly for the OS type in configure (which we don't do anywhere so far), or test for individual objective C methods. This approach allows the code to compile, but no input devices will be found at runtime. Signed-off-by: Martin Storsjö <[email protected]>
1 parent 46762c8 commit 69bab4e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libavdevice/avfoundation.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,8 +814,10 @@ static int get_audio_config(AVFormatContext *s)
814814
mediaType:mediaType
815815
position:AVCaptureDevicePositionUnspecified];
816816
return [captureDeviceDiscoverySession devices];
817-
#else
817+
#elif TARGET_OS_OSX
818818
return [AVCaptureDevice devicesWithMediaType:mediaType];
819+
#else
820+
return nil;
819821
#endif
820822
}
821823

0 commit comments

Comments
 (0)