mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-12-19 08:57:00 -05:00
* add first part of zeroconf publisher
* bump version to 0.7.1. * improve logging subsystem (introducing log levels) * remove verbose flag on cli * add new API pa_sample_format_to_string() * replace strtol() by usages of pa_atou() and pa_atoi() git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@317 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
5be9641ffe
commit
73eabece33
38 changed files with 467 additions and 280 deletions
|
|
@ -84,7 +84,7 @@ int pa_sample_spec_equal(const struct pa_sample_spec*a, const struct pa_sample_s
|
|||
return (a->format == b->format) && (a->rate == b->rate) && (a->channels == b->channels);
|
||||
}
|
||||
|
||||
void pa_sample_spec_snprint(char *s, size_t l, const struct pa_sample_spec *spec) {
|
||||
const char *pa_sample_format_to_string(enum pa_sample_format f) {
|
||||
static const char* const table[]= {
|
||||
[PA_SAMPLE_U8] = "U8",
|
||||
[PA_SAMPLE_ALAW] = "ALAW",
|
||||
|
|
@ -95,12 +95,21 @@ void pa_sample_spec_snprint(char *s, size_t l, const struct pa_sample_spec *spec
|
|||
[PA_SAMPLE_FLOAT32BE] = "FLOAT32BE",
|
||||
};
|
||||
|
||||
if (f >= PA_SAMPLE_MAX)
|
||||
return NULL;
|
||||
|
||||
return table[f];
|
||||
}
|
||||
|
||||
void pa_sample_spec_snprint(char *s, size_t l, const struct pa_sample_spec *spec) {
|
||||
assert(s && l && spec);
|
||||
|
||||
if (!pa_sample_spec_valid(spec)) {
|
||||
snprintf(s, l, "Invalid");
|
||||
return;
|
||||
}
|
||||
|
||||
snprintf(s, l, "%s %uch %uHz", table[spec->format], spec->channels, spec->rate);
|
||||
snprintf(s, l, "%s %uch %uHz", pa_sample_format_to_string(spec->format), spec->channels, spec->rate);
|
||||
}
|
||||
|
||||
pa_volume_t pa_volume_multiply(pa_volume_t a, pa_volume_t b) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue