diff options
Diffstat (limited to 'src/audio_out')
-rw-r--r-- | src/audio_out/audio_fusionsound_out.c | 45 | ||||
-rw-r--r-- | src/audio_out/audio_pulse_out.c | 5 |
2 files changed, 42 insertions, 8 deletions
diff --git a/src/audio_out/audio_fusionsound_out.c b/src/audio_out/audio_fusionsound_out.c index a79d21213..b33850c5e 100644 --- a/src/audio_out/audio_fusionsound_out.c +++ b/src/audio_out/audio_fusionsound_out.c @@ -47,6 +47,12 @@ #define FUSIONSOUND_VERSION_CODE VERSION_CODE( FUSIONSOUND_MAJOR_VERSION, \ FUSIONSOUND_MINOR_VERSION, \ FUSIONSOUND_MICRO_VERSION ) + +#if FUSIONSOUND_VERSION_CODE >= VERSION_CODE(1,1,0) +# include <fusionsound_limits.h> /* defines FS_MAX_CHANNELS */ +#else +# define FS_MAX_CHANNELS 2 +#endif #define AO_OUT_FS_IFACE_VERSION 9 @@ -100,7 +106,29 @@ static int ao_fusionsound_open(ao_driver_t *ao_driver, break; case AO_CAP_MODE_STEREO: dsc.channels = 2; - break; + break; +#if FS_MAX_CHANNELS > 2 + case AO_CAP_MODE_4CHANNEL: + dsc.channels = 4; + dsc.channelmode = FSCM_SURROUND40_2F2R; + dsc.flags |= FSBDF_CHANNELMODE; + break; + case AO_CAP_MODE_4_1CHANNEL: + dsc.channels = 5; + dsc.channelmode = FSCM_SURROUND41_2F2R; + dsc.flags |= FSBDF_CHANNELMODE; + break; + case AO_CAP_MODE_5CHANNEL: + dsc.channels = 5; + dsc.channelmode = FSCM_SURROUND50; + dsc.flags |= FSBDF_CHANNELMODE; + break; + case AO_CAP_MODE_5_1CHANNEL: + dsc.channels = 6; + dsc.channelmode = FSCM_SURROUND51; + dsc.flags |= FSBDF_CHANNELMODE; + break; +#endif default: xprintf (this->xine, XINE_VERBOSITY_LOG, "audio_fusionsound_out: mode %#x not supported\n", mode); @@ -250,13 +278,18 @@ static void ao_fusionsound_close(ao_driver_t *ao_driver){ */ static uint32_t ao_fusionsound_get_capabilities(ao_driver_t *ao_driver) { + uint32_t caps = AO_CAP_MODE_MONO | AO_CAP_MODE_STEREO | + AO_CAP_MIXER_VOL | AO_CAP_MUTE_VOL | + AO_CAP_8BITS | AO_CAP_16BITS | + AO_CAP_24BITS; #if FUSIONSOUND_VERSION_CODE >= VERSION_CODE(0,9,26) - return (AO_CAP_MODE_MONO | AO_CAP_MODE_STEREO | AO_CAP_MIXER_VOL | - AO_CAP_8BITS | AO_CAP_16BITS | AO_CAP_24BITS | AO_CAP_FLOAT32); -#else - return (AO_CAP_MODE_MONO | AO_CAP_MODE_STEREO | AO_CAP_MIXER_VOL | - AO_CAP_8BITS | AO_CAP_16BITS | AO_CAP_24BITS); + caps |= AO_CAP_FLOAT32; +#endif +#if FS_MAX_CHANNELS > 2 + caps |= AO_CAP_MODE_4CHANNEL | AO_CAP_MODE_4_1CHANNEL | + AO_CAP_MODE_5CHANNEL | AO_CAP_MODE_5_1CHANNEL; #endif + return caps; } static void ao_fusionsound_exit(ao_driver_t *ao_driver) { diff --git a/src/audio_out/audio_pulse_out.c b/src/audio_out/audio_pulse_out.c index b4ec0b156..0235a4321 100644 --- a/src/audio_out/audio_pulse_out.c +++ b/src/audio_out/audio_pulse_out.c @@ -246,7 +246,7 @@ static int ao_pulse_open(ao_driver_t *this_gen, pa_threaded_mainloop_lock(this->pa_class->mainloop); ret = pa_context_connect(this->pa_class->context, this->host, 1, NULL); if ( ret < 0 ) - goto fail; + goto fail_unlock; pa_context_set_state_callback(this->pa_class->context, __xine_pa_context_status_callback, this); @@ -289,8 +289,9 @@ static int ao_pulse_open(ao_driver_t *this_gen, return this->sample_rate; -fail: + fail_unlock: pa_threaded_mainloop_unlock(this->pa_class->mainloop); + fail: this_gen->close(this_gen); return 0; } |