From 3709666344736da68472f754ac52edc356039058 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 9 Jan 2008 03:03:32 +0000 Subject: Fix frame_size calculation when there already is data in the buffer --- audio/pcm_bluetooth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'audio') 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)); -- cgit