mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2025-06-03 00:00:20 +00:00
Fixed number of samples returned.
This commit is contained in:
parent
00b073adda
commit
ec83f3d4f1
@ -125,7 +125,6 @@ static DWORD WINAPI audin_alsa_thread_func(LPVOID arg)
|
|||||||
snd_pcm_t* capture_handle = NULL;
|
snd_pcm_t* capture_handle = NULL;
|
||||||
AudinALSADevice* alsa = (AudinALSADevice*) arg;
|
AudinALSADevice* alsa = (AudinALSADevice*) arg;
|
||||||
DWORD status;
|
DWORD status;
|
||||||
size_t rest = 0;
|
|
||||||
WLog_Print(alsa->log, WLOG_DEBUG, "in");
|
WLog_Print(alsa->log, WLOG_DEBUG, "in");
|
||||||
|
|
||||||
if ((error = snd_pcm_open(&capture_handle, alsa->device_name,
|
if ((error = snd_pcm_open(&capture_handle, alsa->device_name,
|
||||||
@ -166,17 +165,6 @@ static DWORD WINAPI audin_alsa_thread_func(LPVOID arg)
|
|||||||
if (status == WAIT_OBJECT_0)
|
if (status == WAIT_OBJECT_0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (rest > 0)
|
|
||||||
{
|
|
||||||
frames += rest;
|
|
||||||
rest = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
rest = frames % alsa->aformat.nBlockAlign;
|
|
||||||
frames -= rest;
|
|
||||||
}
|
|
||||||
|
|
||||||
error = snd_pcm_readi(capture_handle, buffer, frames);
|
error = snd_pcm_readi(capture_handle, buffer, frames);
|
||||||
|
|
||||||
if (error == 0)
|
if (error == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user