mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
modules: handle x11 sample fallback better
This commit is contained in:
parent
b1a989f62e
commit
5c894c2283
1 changed files with 6 additions and 4 deletions
|
|
@ -107,11 +107,13 @@ static int play_sample(struct impl *impl, const char *sample)
|
||||||
res = -EIO;
|
res = -EIO;
|
||||||
goto exit_destroy;
|
goto exit_destroy;
|
||||||
}
|
}
|
||||||
res = ca_context_play(ca, 0,
|
if ((res = ca_context_play(ca, 0,
|
||||||
CA_PROP_EVENT_ID, sample,
|
CA_PROP_EVENT_ID, sample,
|
||||||
CA_PROP_MEDIA_NAME, "X11 bell event",
|
CA_PROP_MEDIA_NAME, "X11 bell event",
|
||||||
CA_PROP_CANBERRA_CACHE_CONTROL, "permanent",
|
CA_PROP_CANBERRA_CACHE_CONTROL, "permanent",
|
||||||
NULL);
|
NULL)) < 0) {
|
||||||
|
pw_log_warn("can't play sample (%s): %s", sample, ca_strerror(res));
|
||||||
|
}
|
||||||
|
|
||||||
exit_destroy:
|
exit_destroy:
|
||||||
ca_context_destroy(ca);
|
ca_context_destroy(ca);
|
||||||
|
|
@ -122,7 +124,7 @@ static void display_io(void *data, int fd, uint32_t mask)
|
||||||
{
|
{
|
||||||
struct impl *impl = data;
|
struct impl *impl = data;
|
||||||
XEvent e;
|
XEvent e;
|
||||||
const char *sample;
|
const char *sample = NULL;
|
||||||
|
|
||||||
while (XPending(impl->display)) {
|
while (XPending(impl->display)) {
|
||||||
XNextEvent(impl->display, &e);
|
XNextEvent(impl->display, &e);
|
||||||
|
|
@ -132,7 +134,7 @@ static void display_io(void *data, int fd, uint32_t mask)
|
||||||
|
|
||||||
if (impl->properties)
|
if (impl->properties)
|
||||||
sample = pw_properties_get(impl->properties, "sample.name");
|
sample = pw_properties_get(impl->properties, "sample.name");
|
||||||
else
|
if (sample == NULL)
|
||||||
sample = "bell-window-system";
|
sample = "bell-window-system";
|
||||||
|
|
||||||
pw_log_debug("play sample %s", sample);
|
pw_log_debug("play sample %s", sample);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue