* 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:
Lennart Poettering 2004-12-11 00:10:41 +00:00
parent 5be9641ffe
commit 73eabece33
38 changed files with 467 additions and 280 deletions

View file

@ -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) {