diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2007-08-30 00:45:53 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2007-08-30 00:45:53 +0000 |
commit | 4183300934043b1038c84652848c271a235bc5df (patch) | |
tree | 291e4284f9a642672b872d6474dd1fb2e4fc3fbb | |
parent | 31bd0bed86998f29e89061e5a3b0925c0d2f52a5 (diff) |
Disable the broken optional codec parameters setup
-rw-r--r-- | audio/a2dp.c | 10 | ||||
-rw-r--r-- | audio/unix.c | 19 |
2 files changed, 14 insertions, 15 deletions
diff --git a/audio/a2dp.c b/audio/a2dp.c index 61510313..dafb608a 100644 --- a/audio/a2dp.c +++ b/audio/a2dp.c @@ -240,7 +240,7 @@ static gboolean select_sbc_params(struct sbc_codec_cap *cap, min_bitpool = MAX(2, supported->min_bitpool); max_bitpool = MIN(default_bitpool(cap->frequency, cap->channel_mode), - supported->max_bitpool); + supported->max_bitpool); cap->min_bitpool = min_bitpool; cap->max_bitpool = max_bitpool; @@ -257,9 +257,9 @@ static gboolean a2dp_select_capabilities(struct avdtp_remote_sep *rsep, if (!setup) return FALSE; - if (setup->media_codec) + if (setup->media_codec) { memcpy(&sbc_cap, setup->media_codec->data, sizeof(sbc_cap)); - else { + } else { media_codec = avdtp_get_codec(rsep); if (!media_codec) return FALSE; @@ -311,7 +311,7 @@ static void discovery_complete(struct avdtp *session, GSList *seps, int err, } err = avdtp_set_configuration(session, rsep, lsep, caps, - &setup->stream); + &setup->stream); if (err < 0) { error("avdtp_set_configuration: %s", strerror(-err)); finalize_stream_setup(setup); @@ -1045,7 +1045,7 @@ unsigned int a2dp_source_request_stream(struct avdtp *session, break; if (setup->media_codec) { if (avdtp_stream_has_capability(setup->stream, - setup->media_codec)) { + setup->media_codec)) { if (avdtp_start(session, sep->stream) < 0) { error("avdtp_start failed"); goto failed; diff --git a/audio/unix.c b/audio/unix.c index 5d049dbc..d980861f 100644 --- a/audio/unix.c +++ b/audio/unix.c @@ -405,10 +405,12 @@ static void create_stream(struct device *dev, struct unix_client *client) goto failed; } + /* FIXME: The provided media_codec breaks bitpool + selection. So disable it. This needs fixing */ id = a2dp_source_request_stream(a2dp->session, dev, TRUE, a2dp_setup_complete, client, &a2dp->sep, - client->media_codec); + NULL/*client->media_codec*/); client->cancel_stream = a2dp_source_cancel_stream; break; @@ -533,21 +535,18 @@ static int cfg_to_caps(struct ipc_data_cfg *cfg, struct sbc_codec_cap *sbc_cap) break; } - if (sbc->bitpool > 250) - return -EINVAL; - else if (sbc->bitpool > 0) - sbc_cap->min_bitpool = sbc_cap->max_bitpool = sbc->bitpool; - else { - sbc->bitpool = 32; - sbc_cap->min_bitpool = 2; + if (sbc->bitpool != 0) { + if (sbc->bitpool > 250) + return -EINVAL; + + sbc_cap->min_bitpool = sbc->bitpool; sbc_cap->max_bitpool = sbc->bitpool; } return 0; } -static void cfg_event(struct unix_client *client, struct ipc_packet *pkt, - int len) +static void cfg_event(struct unix_client *client, struct ipc_packet *pkt, int len) { struct device *dev; bdaddr_t bdaddr; |