summaryrefslogtreecommitdiffstats
path: root/audio/pcm_bluetooth.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2007-08-14 22:47:33 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2007-08-14 22:47:33 +0000
commitd661010f0da37d072e9f3e0adcc94964fea6a054 (patch)
treecfee090281515fca1398ac8acab22e9b505dca61 /audio/pcm_bluetooth.c
parent6a069310ac7270e67c58dd13674c4a13860356a0 (diff)
Minor fixes to alsa plugin.
Diffstat (limited to 'audio/pcm_bluetooth.c')
-rw-r--r--audio/pcm_bluetooth.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/audio/pcm_bluetooth.c b/audio/pcm_bluetooth.c
index 1734163a..e7fa6878 100644
--- a/audio/pcm_bluetooth.c
+++ b/audio/pcm_bluetooth.c
@@ -42,7 +42,7 @@
//#define ENABLE_DEBUG
-#define BUFFER_SIZE 1024
+#define BUFFER_SIZE 2048
#ifdef ENABLE_DEBUG
#define DBG(fmt, arg...) printf("DEBUG: %s: " fmt "\n" , __FUNCTION__ , ## arg)
@@ -151,6 +151,9 @@ static void bluetooth_exit(struct bluetooth_data *data)
if (data->stream_fd >= 0)
close(data->stream_fd);
+ if (data->cfg.codec == CFG_CODEC_SBC)
+ sbc_finish(&data->a2dp.sbc);
+
free(data);
}
@@ -241,7 +244,6 @@ static int bluetooth_a2dp_hw_params(snd_pcm_ioplug_t *io,
err = errno;
SNDERR("%s (%d)", strerror(err), err);
- bluetooth_close(io);
return -err;
}
@@ -548,7 +550,7 @@ static snd_pcm_sframes_t bluetooth_a2dp_write(snd_pcm_ioplug_t *io,
a2dp->samples += encoded / frame_size;
a2dp->nsamples += encoded / frame_size;
/* Increment hardware transmition pointer */
- data->hw_ptr = (data->hw_ptr + codesize / frame_size)
+ data->hw_ptr = (data->hw_ptr + encoded / frame_size)
% io->buffer_size;
ret = frames_to_read;