mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
alsa: only expose DSD format when DSD_U32_BE is supported
This commit is contained in:
parent
43b27002eb
commit
25d39a5ea1
1 changed files with 7 additions and 0 deletions
|
|
@ -718,6 +718,7 @@ static int enum_dsd_formats(struct state *state, uint32_t index, uint32_t *next,
|
||||||
int res, err;
|
int res, err;
|
||||||
snd_pcm_t *hndl;
|
snd_pcm_t *hndl;
|
||||||
snd_pcm_hw_params_t *params;
|
snd_pcm_hw_params_t *params;
|
||||||
|
snd_pcm_format_mask_t *fmask;
|
||||||
struct spa_pod_frame f[2];
|
struct spa_pod_frame f[2];
|
||||||
|
|
||||||
if ((index & 0xffff) > 0)
|
if ((index & 0xffff) > 0)
|
||||||
|
|
@ -727,6 +728,12 @@ static int enum_dsd_formats(struct state *state, uint32_t index, uint32_t *next,
|
||||||
snd_pcm_hw_params_alloca(¶ms);
|
snd_pcm_hw_params_alloca(¶ms);
|
||||||
CHECK(snd_pcm_hw_params_any(hndl, params), "Broken configuration: no configurations available");
|
CHECK(snd_pcm_hw_params_any(hndl, params), "Broken configuration: no configurations available");
|
||||||
|
|
||||||
|
snd_pcm_format_mask_alloca(&fmask);
|
||||||
|
snd_pcm_hw_params_get_format_mask(params, fmask);
|
||||||
|
|
||||||
|
if (!snd_pcm_format_mask_test(fmask, SND_PCM_FORMAT_DSD_U32_BE))
|
||||||
|
return 0;
|
||||||
|
|
||||||
CHECK(snd_pcm_hw_params_set_rate_resample(hndl, params, 0), "set_rate_resample");
|
CHECK(snd_pcm_hw_params_set_rate_resample(hndl, params, 0), "set_rate_resample");
|
||||||
|
|
||||||
spa_pod_builder_push_object(b, &f[0], SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat);
|
spa_pod_builder_push_object(b, &f[0], SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue