mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
option to use ALSA default fragment number and size
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@295 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
5f647c8fef
commit
acc8b7890a
5 changed files with 41 additions and 23 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue