[pulseaudio-discuss] Sample format of default source

Lennart Poettering lennart at poettering.net
Wed Mar 18 12:13:15 PDT 2009


On Mon, 16.03.09 20:14, Magnus Hjorth (magnus.hjorth at home.se) wrote:

> Hi,
>
> I'm trying to find a way in libpulse to query the sample format of the  
> default source. Passing NULL to pa_context_get_source_info_by_name does  
> not seem to work ("invalid argument").
>
> The only way I can think of is to create a stream, connect it to the  
> default source, call pa_stream_get_device_name (or index), and pass that  
> name to pa_context_get_source_info_by_name. But that is a quite ugly  
> solution. Any other way to get the default source's name?

Hmm, why would you want to query this? Smells like you are working on
some racy code.

Try passing "@DEFAULT_SOURCE@" as sink name in pa_context_get_source_info_by_name().

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net         ICQ# 11060553
http://0pointer.net/lennart/           GnuPG 0x1A015CC4



More information about the pulseaudio-discuss mailing list