mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-31 22:25:33 -04:00
use pa_source_set_latency_range()/pa_sink_set_latency_range() in the ALSA drivers; fix sleep time calculation
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2460 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
de8a386460
commit
7d0b5958a4
1 changed files with 5 additions and 5 deletions
|
|
@ -262,7 +262,7 @@ static int mmap_read(struct userdata *u, pa_usec_t *sleep_usec) {
|
|||
left_to_record = check_left_to_record(u, n);
|
||||
|
||||
if (u->use_tsched)
|
||||
if (pa_bytes_to_usec(left_to_record, &u->source->sample_spec) > max_sleep_usec/2)
|
||||
if (pa_bytes_to_usec(left_to_record, &u->source->sample_spec) > process_usec+max_sleep_usec/2)
|
||||
break;
|
||||
|
||||
if (PA_UNLIKELY(n <= 0))
|
||||
|
|
@ -359,7 +359,7 @@ static int unix_read(struct userdata *u, pa_usec_t *sleep_usec) {
|
|||
left_to_record = check_left_to_record(u, n);
|
||||
|
||||
if (u->use_tsched)
|
||||
if (pa_bytes_to_usec(left_to_record, &u->source->sample_spec) > max_sleep_usec/2)
|
||||
if (pa_bytes_to_usec(left_to_record, &u->source->sample_spec) > process_usec+max_sleep_usec/2)
|
||||
break;
|
||||
|
||||
if (PA_UNLIKELY(n <= 0))
|
||||
|
|
@ -1152,9 +1152,9 @@ int pa__init(pa_module*m) {
|
|||
if (use_tsched)
|
||||
fix_tsched_watermark(u);
|
||||
|
||||
u->source->max_latency = pa_bytes_to_usec(u->hwbuf_size, &ss);
|
||||
if (!use_tsched)
|
||||
u->source->min_latency = u->source->max_latency;
|
||||
pa_source_set_latency_range(u->source,
|
||||
!use_tsched ? pa_bytes_to_usec(u->hwbuf_size, &ss) : (pa_usec_t) -1,
|
||||
pa_bytes_to_usec(u->hwbuf_size, &ss));
|
||||
|
||||
pa_log_info("Using %u fragments of size %lu bytes, buffer time is %0.2fms",
|
||||
nfrags, (long unsigned) u->fragment_size,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue