mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
format: Make pa_format_info_valid() stricter for PCM
We should do stricter validation when we can.
This commit is contained in:
parent
7f6c4e6ed0
commit
12a202c510
1 changed files with 7 additions and 1 deletions
|
|
@ -101,6 +101,12 @@ void pa_format_info_free(pa_format_info *f) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int pa_format_info_valid(const pa_format_info *f) {
|
int pa_format_info_valid(const pa_format_info *f) {
|
||||||
|
pa_sample_spec ss;
|
||||||
|
|
||||||
|
if (pa_format_info_is_pcm(f)) {
|
||||||
|
pa_format_info_to_sample_spec(f, &ss, NULL);
|
||||||
|
return pa_sample_spec_valid(&ss);
|
||||||
|
} else
|
||||||
return (f->encoding >= 0 && f->encoding < PA_ENCODING_MAX && f->plist != NULL);
|
return (f->encoding >= 0 && f->encoding < PA_ENCODING_MAX && f->plist != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue