diff options
author | Mattias Agren <magren@broadcom.com> | 2012-04-19 23:14:51 +0200 |
---|---|---|
committer | Matthew Xie <mattx@google.com> | 2012-07-14 11:19:17 -0700 |
commit | dba4eb4bc69eeb8ac8e2aeff06bf1d281dc4698f (patch) | |
tree | 1add0d1a4643fcde74a4e25585c7c0b2f511433c /btif/co | |
parent | 0872cc31abb3990b0892898f45bf2c87da627e4c (diff) | |
download | external_bluetooth_bluedroid-dba4eb4bc69eeb8ac8e2aeff06bf1d281dc4698f.zip external_bluetooth_bluedroid-dba4eb4bc69eeb8ac8e2aeff06bf1d281dc4698f.tar.gz external_bluetooth_bluedroid-dba4eb4bc69eeb8ac8e2aeff06bf1d281dc4698f.tar.bz2 |
Stop fetching additional stream endpoints once matching codec cap is
retrieved
Change-Id: I606ec04b10854f63cbea6fbfed3e925d72173322
Diffstat (limited to 'btif/co')
-rw-r--r--[-rwxr-xr-x] | btif/co/bta_av_co.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/btif/co/bta_av_co.c b/btif/co/bta_av_co.c index cd4b9af..01cf4e6 100755..100644 --- a/btif/co/bta_av_co.c +++ b/btif/co/bta_av_co.c @@ -369,12 +369,6 @@ BTA_API UINT8 bta_av_co_audio_getconfig(tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_t APPL_TRACE_DEBUG4("bta_av_co_audio_getconfig peer(o=%d,n_snks=%d,n_rx_snks=%d,n_sup_snks=%d)", p_peer->opened, p_peer->num_snks, p_peer->num_rx_snks, p_peer->num_sup_snks); - /* Sanity check: should not be opened at this point */ - if (p_peer->opened) - { - APPL_TRACE_ERROR0("bta_av_co_audio_getconfig peer already in use"); - } - /* Increment the number of received sinks capabilities */ p_peer->num_rx_snks++; @@ -386,7 +380,6 @@ BTA_API UINT8 bta_av_co_audio_getconfig(tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_t supported = TRUE; break; - default: break; } @@ -427,6 +420,13 @@ BTA_API UINT8 bta_av_co_audio_getconfig(tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_t /* Find a sink that matches the codec config */ if (bta_av_co_audio_peer_supports_codec(p_peer, &index)) { + /* stop fetching caps once we retrieved a supported codec */ + if (p_peer->acp) + { + *p_sep_info_idx = p_peer->num_snks; + APPL_TRACE_EVENT0("no need to fetch more SEPs"); + } + p_sink = &p_peer->snks[index]; /* Build the codec configuration for this sink */ |