summaryrefslogtreecommitdiffstats
path: root/audio/pcm_bluetooth.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2007-08-14 17:25:35 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2007-08-14 17:25:35 +0000
commit98a002b710efe17ec1c65cb6e338908361549a72 (patch)
treed68fbd8a3b1d79d67112ff14d3c4a112bff22806 /audio/pcm_bluetooth.c
parente98f93aa5bc0ca18e0544c448690ad7b9a0df6e1 (diff)
Cleanup the sbc codec when the plugin is deinitialized
Diffstat (limited to 'audio/pcm_bluetooth.c')
-rw-r--r--audio/pcm_bluetooth.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/audio/pcm_bluetooth.c b/audio/pcm_bluetooth.c
index d0601a9f..6eb59a7d 100644
--- a/audio/pcm_bluetooth.c
+++ b/audio/pcm_bluetooth.c
@@ -165,6 +165,15 @@ static int bluetooth_close(snd_pcm_ioplug_t *io)
return 0;
}
+static int bluetooth_a2dp_close(snd_pcm_ioplug_t *io)
+{
+ struct bluetooth_data *data = io->private_data;
+
+ sbc_finish(&data->a2dp.sbc);
+
+ return bluetooth_close(io);
+}
+
static int bluetooth_prepare(snd_pcm_ioplug_t *io)
{
struct bluetooth_data *data = io->private_data;
@@ -574,7 +583,7 @@ static snd_pcm_ioplug_callback_t bluetooth_a2dp_playback = {
.start = bluetooth_start,
.stop = bluetooth_stop,
.pointer = bluetooth_pointer,
- .close = bluetooth_close,
+ .close = bluetooth_a2dp_close,
.hw_params = bluetooth_a2dp_hw_params,
.prepare = bluetooth_prepare,
.transfer = bluetooth_a2dp_write,
@@ -584,7 +593,7 @@ static snd_pcm_ioplug_callback_t bluetooth_a2dp_capture = {
.start = bluetooth_start,
.stop = bluetooth_stop,
.pointer = bluetooth_pointer,
- .close = bluetooth_close,
+ .close = bluetooth_a2dp_close,
.hw_params = bluetooth_a2dp_hw_params,
.prepare = bluetooth_prepare,
.transfer = bluetooth_a2dp_read,