mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-07 13:30:03 -05:00
raop: Don't use incompatible default sample spec parameters
Since the RAOP sink supports only some formats and channel counts, we shouldn't blindly use pa_core.default_sample_spec. This patch changes things so that we default to PA_SAMPLE_S16NE and 2 channels, and only take the sample rate from pa_core.default_sample_spec.
This commit is contained in:
parent
dc2299e961
commit
b1c4e7bf6b
1 changed files with 5 additions and 3 deletions
|
|
@ -518,15 +518,17 @@ int pa__init(pa_module*m) {
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
ss = m->core->default_sample_spec;
|
ss.format = PA_SAMPLE_S16NE;
|
||||||
|
ss.channels = 2;
|
||||||
|
ss.rate = m->core->default_sample_spec.rate;
|
||||||
if (pa_modargs_get_sample_spec(ma, &ss) < 0) {
|
if (pa_modargs_get_sample_spec(ma, &ss) < 0) {
|
||||||
pa_log("invalid sample format specification");
|
pa_log("invalid sample format specification");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((/*ss.format != PA_SAMPLE_U8 &&*/ ss.format != PA_SAMPLE_S16NE) ||
|
if ((ss.format != PA_SAMPLE_S16NE) ||
|
||||||
(ss.channels > 2)) {
|
(ss.channels > 2)) {
|
||||||
pa_log("sample type support is limited to mono/stereo and U8 or S16NE sample data");
|
pa_log("sample type support is limited to mono/stereo and S16NE sample data");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue