mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-16 06:59:55 -05:00
Merge commit 'elmarco/bluetooth-fixes'
This commit is contained in:
commit
2928b44c53
3 changed files with 16 additions and 11 deletions
|
|
@ -604,7 +604,7 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *m, void *us
|
|||
pa_bluetooth_device_free(d);
|
||||
}
|
||||
|
||||
return DBUS_HANDLER_RESULT_HANDLED;
|
||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
|
||||
} else if (dbus_message_is_signal(m, "org.bluez.Adapter", "DeviceCreated")) {
|
||||
const char *path;
|
||||
|
|
@ -617,7 +617,7 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *m, void *us
|
|||
pa_log_debug("Device %s created", path);
|
||||
|
||||
found_device(y, path);
|
||||
return DBUS_HANDLER_RESULT_HANDLED;
|
||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
|
||||
} else if (dbus_message_is_signal(m, "org.bluez.Manager", "AdapterAdded")) {
|
||||
const char *path;
|
||||
|
|
@ -630,7 +630,7 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *m, void *us
|
|||
pa_log_debug("Adapter %s created", path);
|
||||
|
||||
found_adapter(y, path);
|
||||
return DBUS_HANDLER_RESULT_HANDLED;
|
||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
|
||||
} else if (dbus_message_is_signal(m, "org.bluez.Headset", "PropertyChanged") ||
|
||||
dbus_message_is_signal(m, "org.bluez.AudioSink", "PropertyChanged") ||
|
||||
|
|
@ -663,7 +663,7 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *m, void *us
|
|||
run_callback(y, d, TRUE);
|
||||
}
|
||||
|
||||
return DBUS_HANDLER_RESULT_HANDLED;
|
||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
}
|
||||
|
||||
fail:
|
||||
|
|
|
|||
|
|
@ -700,6 +700,9 @@ static int start_stream_fd(struct userdata *u) {
|
|||
pollfd->fd = u->stream_fd;
|
||||
pollfd->events = pollfd->revents = 0;
|
||||
|
||||
u->read_index = 0;
|
||||
u->write_index = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -873,7 +876,7 @@ static int hsp_process_render(struct userdata *u) {
|
|||
pa_assert(l != 0);
|
||||
|
||||
if (l < 0) {
|
||||
if (errno == EINTR)
|
||||
if (errno == EINTR || errno == EAGAIN)
|
||||
continue;
|
||||
else {
|
||||
pa_log_error("Failed to write data to SCO socket: %s", pa_cstrerror(errno));
|
||||
|
|
@ -918,7 +921,7 @@ static int hsp_process_push(struct userdata *u) {
|
|||
pa_memblock_release(memchunk.memblock);
|
||||
|
||||
if (l <= 0) {
|
||||
if (l < 0 && errno == EINTR)
|
||||
if (l < 0 && (errno == EINTR || errno == EAGAIN))
|
||||
continue;
|
||||
else {
|
||||
pa_log_error("Failed to read data from SCO socket: %s", l < 0 ? pa_cstrerror(errno) : "EOF");
|
||||
|
|
@ -1041,7 +1044,7 @@ static int a2dp_process_render(struct userdata *u) {
|
|||
pa_assert(l != 0);
|
||||
|
||||
if (l < 0) {
|
||||
if (errno == EINTR)
|
||||
if (errno == EINTR || errno == EAGAIN)
|
||||
continue;
|
||||
else {
|
||||
pa_log_error("Failed to write data to socket: %s", pa_cstrerror(errno));
|
||||
|
|
@ -1123,6 +1126,8 @@ static void thread_func(void *userdata) {
|
|||
}
|
||||
|
||||
if (writable && do_write) {
|
||||
if (u->write_index == 0)
|
||||
u->started_at = pa_rtclock_usec();
|
||||
|
||||
if (u->profile == PROFILE_A2DP) {
|
||||
if (a2dp_process_render(u) < 0)
|
||||
|
|
@ -1159,8 +1164,8 @@ static void thread_func(void *userdata) {
|
|||
|
||||
/* Hmm, nothing to do. Let's sleep */
|
||||
if (pollfd)
|
||||
pollfd->events = (short) (((u->sink && PA_SINK_IS_OPENED(u->sink->thread_info.state) && !writable) ? POLLOUT : 0) |
|
||||
(u->source && PA_SOURCE_IS_OPENED(u->source->thread_info.state) ? POLLIN : 0));
|
||||
pollfd->events = (short) (((u->sink && PA_SINK_IS_LINKED(u->sink->thread_info.state) && !writable) ? POLLOUT : 0) |
|
||||
(u->source && PA_SOURCE_IS_LINKED(u->source->thread_info.state) ? POLLIN : 0));
|
||||
|
||||
if ((ret = pa_rtpoll_run(u->rtpoll, TRUE)) < 0)
|
||||
goto fail;
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ static DBusHandlerResult filter_func(DBusConnection *connection, DBusMessage *m,
|
|||
|
||||
bonding_new(u, a);
|
||||
|
||||
return DBUS_HANDLER_RESULT_HANDLED;
|
||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
|
||||
} else if (dbus_message_is_signal(m, "org.bluez.Adapter", "BondingRemoved")) {
|
||||
|
||||
|
|
@ -315,7 +315,7 @@ static DBusHandlerResult filter_func(DBusConnection *connection, DBusMessage *m,
|
|||
|
||||
bonding_remove(u, a);
|
||||
|
||||
return DBUS_HANDLER_RESULT_HANDLED;
|
||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
}
|
||||
|
||||
finish:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue