mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-12-23 02:56:30 +01:00
Some cleaning renames. Prepared API for new plugins
This commit is contained in:
parent
4ce15b2f84
commit
5085796784
1 changed files with 5 additions and 6 deletions
|
@ -790,11 +790,10 @@ static void set_params(void)
|
||||||
params.xrun_mode = SND_PCM_XRUN_FLUSH;
|
params.xrun_mode = SND_PCM_XRUN_FLUSH;
|
||||||
params.frag_size = format.rate * frag_length / 1000;
|
params.frag_size = format.rate * frag_length / 1000;
|
||||||
params.buffer_size = format.rate * buffer_length / 1000;
|
params.buffer_size = format.rate * buffer_length / 1000;
|
||||||
params.frames_min = format.rate * min_avail / 1000;
|
params.avail_min = format.rate * min_avail / 1000;
|
||||||
params.frames_xrun_max = 0;
|
|
||||||
params.fill_mode = SND_PCM_FILL_SILENCE;
|
params.fill_mode = SND_PCM_FILL_SILENCE;
|
||||||
params.frames_fill_max = 1024;
|
params.fill_max = 1024;
|
||||||
params.frames_xrun_max = 0;
|
params.xrun_max = 0;
|
||||||
if (snd_pcm_params(handle, ¶ms) < 0) {
|
if (snd_pcm_params(handle, ¶ms) < 0) {
|
||||||
error("unable to set params (where=%x, why=%x)", params.fail_mask, params.fail_reason);
|
error("unable to set params (where=%x, why=%x)", params.fail_mask, params.fail_reason);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
@ -843,7 +842,7 @@ void playback_underrun(void)
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
if (status.state == SND_PCM_STATE_XRUN) {
|
if (status.state == SND_PCM_STATE_XRUN) {
|
||||||
fprintf(stderr, "underrun at position %lu!!!\n", (unsigned long)status.frame_io);
|
fprintf(stderr, "underrun at position %lu!!!\n", (unsigned long)status.hw_ptr);
|
||||||
if ((res = snd_pcm_prepare(handle))<0) {
|
if ((res = snd_pcm_prepare(handle))<0) {
|
||||||
error("underrun: playback prepare error: %s", snd_strerror(res));
|
error("underrun: playback prepare error: %s", snd_strerror(res));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
@ -869,7 +868,7 @@ void capture_overrun(void)
|
||||||
if (status.state == SND_PCM_STATE_RUNNING)
|
if (status.state == SND_PCM_STATE_RUNNING)
|
||||||
return; /* everything is ok, but the driver is waiting for data */
|
return; /* everything is ok, but the driver is waiting for data */
|
||||||
if (status.state == SND_PCM_STATE_XRUN) {
|
if (status.state == SND_PCM_STATE_XRUN) {
|
||||||
fprintf(stderr, "overrun at position %lu!!!\n", (unsigned long)status.frame_io);
|
fprintf(stderr, "overrun at position %lu!!!\n", (unsigned long)status.hw_ptr);
|
||||||
if ((res = snd_pcm_prepare(handle))<0) {
|
if ((res = snd_pcm_prepare(handle))<0) {
|
||||||
error("overrun: capture prepare error: %s", snd_strerror(res));
|
error("overrun: capture prepare error: %s", snd_strerror(res));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
|
Loading…
Reference in a new issue