mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-05 13:29:57 -05:00
read stream and client name from $PADSP_STREAM_NAME resp. $PADSP_CLIENT_NAME, if available
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@965 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
2bbd7bac63
commit
ae80ab396e
1 changed files with 17 additions and 4 deletions
|
|
@ -201,7 +201,7 @@ static int padsp_disabled(void) {
|
||||||
* The symbol must be an int containing a three bit bitmask: bit 1
|
* The symbol must be an int containing a three bit bitmask: bit 1
|
||||||
* -> disable /dev/dsp emulation, bit 2 -> disable /dev/sndstat
|
* -> disable /dev/dsp emulation, bit 2 -> disable /dev/sndstat
|
||||||
* emulation, bit 3 -> disable /dev/mixer emulation. Hence a value
|
* emulation, bit 3 -> disable /dev/mixer emulation. Hence a value
|
||||||
* 7 disables padsp entirely. */
|
* of 7 disables padsp entirely. */
|
||||||
|
|
||||||
pthread_mutex_lock(&func_mutex);
|
pthread_mutex_lock(&func_mutex);
|
||||||
if (!sym_resolved) {
|
if (!sym_resolved) {
|
||||||
|
|
@ -363,15 +363,28 @@ static void reset_params(fd_info *i) {
|
||||||
|
|
||||||
static char *client_name(char *buf, size_t n) {
|
static char *client_name(char *buf, size_t n) {
|
||||||
char p[PATH_MAX];
|
char p[PATH_MAX];
|
||||||
|
const char *e;
|
||||||
|
|
||||||
|
if ((e = getenv("PADSP_CLIENT_NAME")))
|
||||||
|
return e;
|
||||||
|
|
||||||
if (pa_get_binary_name(p, sizeof(p)))
|
if (pa_get_binary_name(p, sizeof(p)))
|
||||||
snprintf(buf, n, "oss[%s]", pa_path_get_filename(p));
|
snprintf(buf, n, "OSS Emulation[%s]", pa_path_get_filename(p));
|
||||||
else
|
else
|
||||||
snprintf(buf, n, "oss");
|
snprintf(buf, n, "OSS");
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *stream_name(void) {
|
||||||
|
const char *e;
|
||||||
|
|
||||||
|
if ((e = getenv("PADSP_STREAM_NAME")))
|
||||||
|
return e;
|
||||||
|
|
||||||
|
return "Audio Stream";
|
||||||
|
}
|
||||||
|
|
||||||
static void atfork_prepare(void) {
|
static void atfork_prepare(void) {
|
||||||
fd_info *i;
|
fd_info *i;
|
||||||
|
|
||||||
|
|
@ -740,7 +753,7 @@ static int create_stream(fd_info *i) {
|
||||||
|
|
||||||
fix_metrics(i);
|
fix_metrics(i);
|
||||||
|
|
||||||
if (!(i->stream = pa_stream_new(i->context, "Audio Stream", &i->sample_spec, NULL))) {
|
if (!(i->stream = pa_stream_new(i->context, stream_name(), &i->sample_spec, NULL))) {
|
||||||
debug(__FILE__": pa_stream_new() failed: %s\n", pa_strerror(pa_context_errno(i->context)));
|
debug(__FILE__": pa_stream_new() failed: %s\n", pa_strerror(pa_context_errno(i->context)));
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue