summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorBrad Midgley <bmidgley@xmission.com>2007-06-08 17:23:29 +0000
committerBrad Midgley <bmidgley@xmission.com>2007-06-08 17:23:29 +0000
commit019dd58ff876fcdaae5a7cd257822955d28b5b96 (patch)
treeb6a40ae578b42f8287569db2e801c3b3b7691112 /audio
parent5b92a5bfe6556e0cfc0d2b55a7486efe1c5aea8b (diff)
backward compatible to old sco patch
Diffstat (limited to 'audio')
-rw-r--r--audio/pcm_bluetooth.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/audio/pcm_bluetooth.c b/audio/pcm_bluetooth.c
index 5057addb..f2d3c275 100644
--- a/audio/pcm_bluetooth.c
+++ b/audio/pcm_bluetooth.c
@@ -135,7 +135,16 @@ static int bluetooth_hw_params(snd_pcm_ioplug_t *io, snd_pcm_hw_params_t *params
sizeof(period_count)) == 0)
return 0;
- SNDERR("Unable to set number of SCO buffers: please upgrade your"
+ /* backward compatible to the old patch */
+
+ opt_name = (io->stream == SND_PCM_STREAM_PLAYBACK) ?
+ SCO_TXBUFS : SCO_RXBUFS;
+
+ if (setsockopt(cfg.fd, SOL_SCO, opt_name, &period_count,
+ sizeof(period_count)) == 0)
+ return 0;
+
+ SNDERR("Unable to set number of SCO buffers: please upgrade your "
"kernel!");
return -EINVAL;
@@ -367,7 +376,7 @@ static int bluetooth_cfg(struct bluetooth_data *data)
}
if (pkt->length != sizeof(struct ipc_data_cfg)) {
- SNDERR("Error while configuring device: packet size doesn't"
+ SNDERR("Error while configuring device: packet size doesn't "
"match");
ret = -EINVAL;
goto done;
@@ -383,7 +392,7 @@ static int bluetooth_cfg(struct bluetooth_data *data)
data->cfg.sample_size, data->cfg.rate);
if (data->cfg.fd == -1) {
- SNDERR("Error while configuring device: could not acquire"
+ SNDERR("Error while configuring device: could not acquire "
"audio socket");
ret = -EINVAL;
goto done;