Start streaming of sound/SDR just before main loop
This prevents buffer overflow during init/creation processes
This commit is contained in:
@@ -112,7 +112,6 @@ error:
|
||||
static int sound_prepare(sound_t *sound)
|
||||
{
|
||||
int rc;
|
||||
int16_t buff[2];
|
||||
|
||||
rc = snd_pcm_prepare(sound->phandle);
|
||||
if (rc < 0) {
|
||||
@@ -126,9 +125,6 @@ static int sound_prepare(sound_t *sound)
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* trigger capturing */
|
||||
snd_pcm_readi(sound->chandle, buff, 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -196,6 +192,18 @@ error:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* start streaming */
|
||||
int sound_start(void *inst)
|
||||
{
|
||||
sound_t *sound = (sound_t *)inst;
|
||||
int16_t buff[2];
|
||||
|
||||
/* trigger capturing */
|
||||
snd_pcm_readi(sound->chandle, buff, 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sound_close(void *inst)
|
||||
{
|
||||
sound_t *sound = (sound_t *)inst;
|
||||
|
Reference in New Issue
Block a user