mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-10 13:29:58 -05:00
add CPU load limiter
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@176 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
c73a298f88
commit
4a9239f808
10 changed files with 392 additions and 40 deletions
|
|
@ -119,3 +119,14 @@ double pa_volume_to_dB(pa_volume_t v) {
|
|||
|
||||
return 20*log10((double) v/PA_VOLUME_NORM);
|
||||
}
|
||||
|
||||
void pa_bytes_snprint(char *s, size_t l, off_t v) {
|
||||
if (v >= 1024*1024*1024)
|
||||
snprintf(s, l, "%0.1f GB", (double) v/1024/1024/1024);
|
||||
else if (v >= 1024*1024)
|
||||
snprintf(s, l, "%0.1f MB", (double) v/1024/1024);
|
||||
else if (v >= 1024)
|
||||
snprintf(s, l, "%0.1f KB", (double) v/1024);
|
||||
else
|
||||
snprintf(s, l, "%u B", (unsigned) v);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue