* set default fragment metrics depending on the sample specs of the device in OSS and ALSA

* fix fragment size calculation in module-alsa-sink


git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@855 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2006-05-13 21:20:34 +00:00
parent 0231e6ea41
commit 0f22d63289
3 changed files with 21 additions and 15 deletions

View file

@ -333,9 +333,11 @@ int pa__init(pa_core *c, pa_module*m) {
}
frame_size = pa_frame_size(&ss);
/* Fix latency to 100ms */
periods = 12;
fragsize = frame_size*1024;
fragsize = pa_bytes_per_second(&ss)/128;
if (pa_modargs_get_value_u32(ma, "fragments", &periods) < 0 || pa_modargs_get_value_u32(ma, "fragment_size", &fragsize) < 0) {
pa_log(__FILE__": failed to parse buffer metrics");
goto fail;
@ -425,7 +427,7 @@ int pa__init(pa_core *c, pa_module*m) {
u->frame_size = frame_size;
u->fragment_size = period_size * frame_size;
pa_log(__FILE__": using %u fragments of size %lu bytes.", periods, (long unsigned) u->fragment_size);
pa_log_info(__FILE__": using %u fragments of size %lu bytes.", periods, (long unsigned) u->fragment_size);
u->memchunk.memblock = NULL;
u->memchunk.index = u->memchunk.length = 0;