mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-31 22:25:33 -04:00
alsa-sink/source: Better thread names
Now you can actually see *which* sink/source that sends a specific message to the log, which is quite useful if you have more than one sound card. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
parent
8cb34c6960
commit
163a7dbe8b
2 changed files with 12 additions and 2 deletions
|
|
@ -2000,6 +2000,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
|
|||
struct userdata *u = NULL;
|
||||
const char *dev_id = NULL, *key, *mod_name;
|
||||
pa_sample_spec ss;
|
||||
char *thread_name = NULL;
|
||||
uint32_t alternate_sample_rate;
|
||||
pa_channel_map map;
|
||||
uint32_t nfrags, frag_size, buffer_size, tsched_size, tsched_watermark, rewind_safeguard;
|
||||
|
|
@ -2346,10 +2347,13 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
|
|||
|
||||
pa_alsa_dump(PA_LOG_DEBUG, u->pcm_handle);
|
||||
|
||||
if (!(u->thread = pa_thread_new("alsa-sink", thread_func, u))) {
|
||||
thread_name = pa_sprintf_malloc("alsa-sink-%s", pa_strnull(pa_proplist_gets(u->sink->proplist, "alsa.id")));
|
||||
if (!(u->thread = pa_thread_new(thread_name, thread_func, u))) {
|
||||
pa_log("Failed to create thread.");
|
||||
goto fail;
|
||||
}
|
||||
pa_xfree(thread_name);
|
||||
thread_name = NULL;
|
||||
|
||||
/* Get initial mixer settings */
|
||||
if (data.volume_is_set) {
|
||||
|
|
@ -2394,6 +2398,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
|
|||
return u->sink;
|
||||
|
||||
fail:
|
||||
pa_xfree(thread_name);
|
||||
|
||||
if (u)
|
||||
userdata_free(u);
|
||||
|
|
|
|||
|
|
@ -1731,6 +1731,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
|
|||
struct userdata *u = NULL;
|
||||
const char *dev_id = NULL, *key, *mod_name;
|
||||
pa_sample_spec ss;
|
||||
char *thread_name = NULL;
|
||||
uint32_t alternate_sample_rate;
|
||||
pa_channel_map map;
|
||||
uint32_t nfrags, frag_size, buffer_size, tsched_size, tsched_watermark;
|
||||
|
|
@ -2058,10 +2059,13 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
|
|||
|
||||
pa_alsa_dump(PA_LOG_DEBUG, u->pcm_handle);
|
||||
|
||||
if (!(u->thread = pa_thread_new("alsa-source", thread_func, u))) {
|
||||
thread_name = pa_sprintf_malloc("alsa-source-%s", pa_strnull(pa_proplist_gets(u->source->proplist, "alsa.id")));
|
||||
if (!(u->thread = pa_thread_new(thread_name, thread_func, u))) {
|
||||
pa_log("Failed to create thread.");
|
||||
goto fail;
|
||||
}
|
||||
pa_xfree(thread_name);
|
||||
thread_name = NULL;
|
||||
|
||||
/* Get initial mixer settings */
|
||||
if (data.volume_is_set) {
|
||||
|
|
@ -2091,6 +2095,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
|
|||
return u->source;
|
||||
|
||||
fail:
|
||||
pa_xfree(thread_name);
|
||||
|
||||
if (u)
|
||||
userdata_free(u);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue