summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-01-09 03:03:32 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2008-01-09 03:03:32 +0000
commit3709666344736da68472f754ac52edc356039058 (patch)
treed38649e8f6fee3488bec2bcf2d9d3cd6ff8dcb29
parent466b76b3f3eab30328476746a964be2c5cbfe869 (diff)
Fix frame_size calculation when there already is data in the buffer
-rw-r--r--audio/pcm_bluetooth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/audio/pcm_bluetooth.c b/audio/pcm_bluetooth.c
index 4b169522..7d5de79f 100644
--- a/audio/pcm_bluetooth.c
+++ b/audio/pcm_bluetooth.c
@@ -786,11 +786,11 @@ static snd_pcm_sframes_t bluetooth_hsp_read(snd_pcm_ioplug_t *io,
DBG("areas->step=%u areas->first=%u offset=%lu size=%lu io->nonblock=%u",
areas->step, areas->first, offset, size, io->nonblock);
+ frame_size = areas->step / 8;
+
if (data->count > 0)
goto proceed;
- frame_size = areas->step / 8;
-
nrecv = recv(data->stream.fd, data->buffer, data->link_mtu,
MSG_WAITALL | (io->nonblock ? MSG_DONTWAIT : 0));