diff options
author | Chris Robinson <[email protected]> | 2010-01-22 21:20:08 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-01-22 21:20:08 -0800 |
commit | 56379bffac509ccf03d4cbe2c7761e4042304e9b (patch) | |
tree | bc1509f76ec71a8947425c16774fe3bdc73786b4 /Alc/pulseaudio.c | |
parent | 11d7a0e394b6ec4fcc23b73800fbe7eb0bb8bc70 (diff) |
Use pa_channel_map_superset only when available with PulseAudio 0.9.15
pa_channel_map_equal can otherwise detect some compatible output modes
Diffstat (limited to 'Alc/pulseaudio.c')
-rw-r--r-- | Alc/pulseaudio.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Alc/pulseaudio.c b/Alc/pulseaudio.c index 4b28ccce..69d80703 100644 --- a/Alc/pulseaudio.c +++ b/Alc/pulseaudio.c @@ -97,12 +97,13 @@ MAKE_FUNC(pa_threaded_mainloop_lock); MAKE_FUNC(pa_channel_map_init_auto); MAKE_FUNC(pa_channel_map_parse); MAKE_FUNC(pa_channel_map_snprint); -MAKE_FUNC(pa_channel_map_superset); +MAKE_FUNC(pa_channel_map_equal); MAKE_FUNC(pa_context_get_server_info); MAKE_FUNC(pa_context_get_sink_info_by_name); MAKE_FUNC(pa_operation_get_state); MAKE_FUNC(pa_operation_unref); #if PA_CHECK_VERSION(0,9,15) +MAKE_FUNC(pa_channel_map_superset); MAKE_FUNC(pa_stream_set_buffer_attr_callback); #endif #if PA_CHECK_VERSION(0,9,16) @@ -238,12 +239,13 @@ LOAD_FUNC(pa_threaded_mainloop_lock); LOAD_FUNC(pa_channel_map_init_auto); LOAD_FUNC(pa_channel_map_parse); LOAD_FUNC(pa_channel_map_snprint); -LOAD_FUNC(pa_channel_map_superset); +LOAD_FUNC(pa_channel_map_equal); LOAD_FUNC(pa_context_get_server_info); LOAD_FUNC(pa_context_get_sink_info_by_name); LOAD_FUNC(pa_operation_get_state); LOAD_FUNC(pa_operation_unref); #if PA_CHECK_VERSION(0,9,15) +LOAD_OPTIONAL_FUNC(pa_channel_map_superset); LOAD_OPTIONAL_FUNC(pa_stream_set_buffer_attr_callback); #endif #if PA_CHECK_VERSION(0,9,16) @@ -392,8 +394,15 @@ static void sink_info_callback(pa_context *context, const pa_sink_info *info, in for(i = 0;chanmaps[i].str;i++) { pa_channel_map map; - if(ppa_channel_map_parse(&map, chanmaps[i].str) && - ppa_channel_map_superset(&info->channel_map, &map)) + if(!ppa_channel_map_parse(&map, chanmaps[i].str)) + continue; + + if(ppa_channel_map_equal(&info->channel_map, &map) +#if PA_CHECK_VERSION(0,9,15) + || (ppa_channel_map_superset && + ppa_channel_map_superset(&info->channel_map, &map)) +#endif + ) { device->Format = chanmaps[i].format; return; |