summaryrefslogtreecommitdiffstats
path: root/polyp/module-alsa-source.c
diff options
context:
space:
mode:
Diffstat (limited to 'polyp/module-alsa-source.c')
-rw-r--r--polyp/module-alsa-source.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/polyp/module-alsa-source.c b/polyp/module-alsa-source.c
index ba09d319..56eb1455 100644
--- a/polyp/module-alsa-source.c
+++ b/polyp/module-alsa-source.c
@@ -166,7 +166,7 @@ int pa__init(struct pa_core *c, struct pa_module*m) {
const char *dev;
struct pa_sample_spec ss;
unsigned periods, fragsize;
- snd_pcm_uframes_t buffer_size;
+ snd_pcm_uframes_t period_size;
size_t frame_size;
if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {
@@ -187,7 +187,7 @@ int pa__init(struct pa_core *c, struct pa_module*m) {
pa_log(__FILE__": failed to parse buffer metrics\n");
goto fail;
}
- buffer_size = fragsize/frame_size*periods;
+ period_size = fragsize;
u = pa_xmalloc0(sizeof(struct userdata));
m->userdata = u;
@@ -198,7 +198,7 @@ int pa__init(struct pa_core *c, struct pa_module*m) {
goto fail;
}
- if (pa_alsa_set_hw_params(u->pcm_handle, &ss, &periods, &buffer_size) < 0) {
+ if (pa_alsa_set_hw_params(u->pcm_handle, &ss, &periods, &period_size) < 0) {
pa_log(__FILE__": Failed to set hardware parameters\n");
goto fail;
}
@@ -217,7 +217,7 @@ int pa__init(struct pa_core *c, struct pa_module*m) {
}
u->frame_size = frame_size;
- u->fragment_size = buffer_size*u->frame_size/periods;
+ u->fragment_size = period_size;
pa_log(__FILE__": using %u fragments of size %u bytes.\n", periods, u->fragment_size);