Skip to content

Commit

Permalink
ao/audiotrack: added option to disable audiotrack
Browse files Browse the repository at this point in the history
  • Loading branch information
jambonmcyeah committed Feb 8, 2025
1 parent e4b64fb commit 9ef1943
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion audio/out/ao.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ extern const struct ao_driver audio_out_sdl;

static const struct ao_driver * const audio_out_drivers[] = {
// native:
#if HAVE_ANDROID
#if HAVE_AUDIOTRACK
&audio_out_audiotrack,
#endif
#if HAVE_AUDIOUNIT
Expand Down
9 changes: 7 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,7 @@ endif
features += {'android': host_machine.system() == 'android'}
if features['android']
dependencies += cc.find_library('android')
sources += files('audio/out/ao_audiotrack.c',
'misc/jni.c',
sources += files('misc/jni.c',
'osdep/android/strnlen.c',
'video/out/android_common.c',
'video/out/vo_mediacodec_embed.c')
Expand Down Expand Up @@ -869,6 +868,12 @@ if features['openal']
sources += files('audio/out/ao_openal.c')
endif

features += {'audiotrack':
get_option('audiotrack').require(features['android']).allowed()}
if features['audiotrack']
sources += files('audio/out/ao_audiotrack.c')
endif

opensles = cc.find_library('OpenSLES', required: get_option('opensles'))
features += {'opensles': opensles.found()}
if features['opensles']
Expand Down
1 change: 1 addition & 0 deletions meson.options
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ option('coreaudio', type: 'feature', value: 'auto', description: 'CoreAudio audi
option('avfoundation', type: 'feature', value: 'auto', description: 'AVFoundation audio output')
option('jack', type: 'feature', value: 'auto', description: 'JACK audio output')
option('openal', type: 'feature', value: 'disabled', description: 'OpenAL audio output')
option('audiotrack', type: 'feature', value: 'auto', description: 'Android AudioTrack audio output')
option('opensles', type: 'feature', value: 'auto', description: 'OpenSL ES audio output')
option('oss-audio', type: 'feature', value: 'auto', description: 'OSSv4 audio output')
option('pipewire', type: 'feature', value: 'auto', description: 'PipeWire audio output')
Expand Down

0 comments on commit 9ef1943

Please sign in to comment.