pw-cat: fix DSD file reading

Now that the server asks for the right amount of samples for DSD, just
give it the right amount of samples without doing some weird scaling.

Make a method to calculate the size (stride) of one sample, which
depends on the interleave and channels of the stream.

See !2540
This commit is contained in:
Wim Taymans 2025-09-25 13:56:51 +02:00
parent f8389cbdb7
commit 19198d2982
5 changed files with 17 additions and 11 deletions

View file

@ -870,7 +870,7 @@ on_param_changed(void *userdata, uint32_t id, const struct spa_pod *param)
data->dff.layout.channels = info.info.dsd.channels;
data->dff.layout.lsb = info.info.dsd.bitorder == SPA_PARAM_BITORDER_lsb;
data->stride = data->dsf.layout.channels * SPA_ABS(data->dsf.layout.interleave);
data->stride = dsf_layout_stride(&data->dsf.layout);
if (data->verbose) {
fprintf(stderr, "DSD: channels:%d bitorder:%s interleave:%d stride:%d\n",