mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
dsd: show rate in bytes per seconds.
This commit is contained in:
parent
1c3802bd82
commit
0ec77ab09c
3 changed files with 9 additions and 10 deletions
|
|
@ -63,7 +63,7 @@ struct spa_audio_info_dsd {
|
|||
enum spa_param_bitorder bitorder; /*< the order of the bits */
|
||||
uint32_t flags; /*< extra flags */
|
||||
int32_t interleave; /*< interleave bytes */
|
||||
uint32_t rate; /*< sample rate (in bits per second) */
|
||||
uint32_t rate; /*< sample rate (in bytes per second) */
|
||||
uint32_t channels; /*< channels */
|
||||
uint32_t position[SPA_AUDIO_MAX_CHANNELS]; /*< channel position from enum spa_audio_channel */
|
||||
};
|
||||
|
|
|
|||
|
|
@ -374,7 +374,7 @@ static void sanitize_map(snd_pcm_chmap_t* map)
|
|||
}
|
||||
}
|
||||
|
||||
static int add_rate(struct state *state, uint32_t index, uint32_t *next,
|
||||
static int add_rate(struct state *state, uint32_t scale, uint32_t index, uint32_t *next,
|
||||
snd_pcm_hw_params_t *params, struct spa_pod_builder *b)
|
||||
{
|
||||
struct spa_pod_frame f[1];
|
||||
|
|
@ -400,10 +400,10 @@ static int add_rate(struct state *state, uint32_t index, uint32_t *next,
|
|||
|
||||
rate = state->position ? state->position->clock.rate.denom : DEFAULT_RATE;
|
||||
|
||||
spa_pod_builder_int(b, SPA_CLAMP(rate, min, max));
|
||||
spa_pod_builder_int(b, SPA_CLAMP(rate, min, max) * scale);
|
||||
if (min != max) {
|
||||
spa_pod_builder_int(b, min);
|
||||
spa_pod_builder_int(b, max);
|
||||
spa_pod_builder_int(b, min * scale);
|
||||
spa_pod_builder_int(b, max * scale);
|
||||
choice->body.type = SPA_CHOICE_Range;
|
||||
}
|
||||
spa_pod_builder_pop(b, &f[0]);
|
||||
|
|
@ -611,7 +611,7 @@ static int enum_pcm_formats(struct state *state, uint32_t index, uint32_t *next,
|
|||
choice->body.type = SPA_CHOICE_Enum;
|
||||
spa_pod_builder_pop(b, &f[1]);
|
||||
|
||||
if ((res = add_rate(state, index & 0xffff, next, params, b)) != 1)
|
||||
if ((res = add_rate(state, 1, index & 0xffff, next, params, b)) != 1)
|
||||
return res;
|
||||
|
||||
if ((res = add_channels(state, index & 0xffff, next, params, b)) != 1)
|
||||
|
|
@ -704,7 +704,7 @@ static int enum_iec958_formats(struct state *state, uint32_t index, uint32_t *ne
|
|||
}
|
||||
spa_pod_builder_pop(b, &f[1]);
|
||||
|
||||
if ((res = add_rate(state, index & 0xffff, next, params, b)) != 1)
|
||||
if ((res = add_rate(state, 1, index & 0xffff, next, params, b)) != 1)
|
||||
return res;
|
||||
|
||||
(*next)++;
|
||||
|
|
@ -759,7 +759,7 @@ static int enum_dsd_formats(struct state *state, uint32_t index, uint32_t *next,
|
|||
spa_pod_builder_prop(b, SPA_FORMAT_AUDIO_interleave, 0);
|
||||
spa_pod_builder_int(b, interleave);
|
||||
|
||||
if ((res = add_rate(state, index & 0xffff, next, params, b)) != 1)
|
||||
if ((res = add_rate(state, SPA_ABS(interleave), index & 0xffff, next, params, b)) != 1)
|
||||
return res;
|
||||
|
||||
if ((res = add_channels(state, index & 0xffff, next, params, b)) != 1)
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ static void on_process(void *userdata)
|
|||
if ((d = buf->datas[0].data) == NULL)
|
||||
return;
|
||||
|
||||
stride = data->info.channels * data->layout.interleave;
|
||||
stride = data->info.channels * SPA_ABS(data->layout.interleave);
|
||||
|
||||
samples = dsf_file_read(data->f, d, buf->datas[0].maxsize / stride,
|
||||
&data->layout);
|
||||
|
|
@ -127,7 +127,6 @@ struct layout_info {
|
|||
uint32_t type;
|
||||
struct spa_audio_layout_info info;
|
||||
};
|
||||
|
||||
static const struct layout_info layouts[] = {
|
||||
{ 1, { SPA_AUDIO_LAYOUT_Mono, }, },
|
||||
{ 2, { SPA_AUDIO_LAYOUT_Stereo, }, },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue