mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
bluez5: reacquire transport always for playing for A2DP
Some A2DP devices don't like reusing the same transport for different media-sink instances, possibly because encoder is reset in between and there can be a gap in transmitted audio. This doesn't matter for SCO/ISO.
This commit is contained in:
parent
ee41c29de5
commit
8f6d266632
1 changed files with 5 additions and 3 deletions
|
|
@ -193,13 +193,14 @@ struct spa_bt_media_codec_switch {
|
|||
* stopped/started rapidly, postpone release until the transport has remained
|
||||
* unused for a time.
|
||||
*
|
||||
* Avoiding unnecessary release+reacquire also makes sense for other transports,
|
||||
* so we use the release timeout for all of them.
|
||||
* Avoiding unnecessary release+reacquire also makes sense for ISO.
|
||||
*/
|
||||
#define TRANSPORT_RELEASE_TIMEOUT_MSEC 1000
|
||||
|
||||
#define TRANSPORT_VOLUME_TIMEOUT_MSEC 200
|
||||
|
||||
#define SPA_BT_TRANSPORT_IS_A2DP(transport) ((transport)->profile & (SPA_BT_PROFILE_A2DP_SOURCE | SPA_BT_PROFILE_A2DP_SINK))
|
||||
|
||||
static int spa_bt_transport_stop_volume_timer(struct spa_bt_transport *transport);
|
||||
static int spa_bt_transport_start_volume_timer(struct spa_bt_transport *transport);
|
||||
static int spa_bt_transport_stop_release_timer(struct spa_bt_transport *transport);
|
||||
|
|
@ -2700,7 +2701,8 @@ int spa_bt_transport_release(struct spa_bt_transport *transport)
|
|||
/* Postpone active transport releases, since we might need it again soon.
|
||||
* If not active, release now since it has to be reacquired before using again.
|
||||
*/
|
||||
if (transport->state == SPA_BT_TRANSPORT_STATE_ACTIVE) {
|
||||
if (transport->state == SPA_BT_TRANSPORT_STATE_ACTIVE &&
|
||||
!SPA_BT_TRANSPORT_IS_A2DP(transport)) {
|
||||
return spa_bt_transport_start_release_timer(transport);
|
||||
} else {
|
||||
spa_bt_transport_do_release(transport);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue