Skip to content

Commit

Permalink
ao_pipewire: explicitly pass samplerate to pipewire
Browse files Browse the repository at this point in the history
  • Loading branch information
t-8ch committed Dec 16, 2021
1 parent 72723d3 commit 8cabe65
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions audio/out/ao_pipewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ static int init(struct ao *ao)
struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));
const struct spa_pod *params[1];
char latency_str[64];
char samplerate_str[8];

enum spa_audio_format spa_format = af_fmt_to_pw(ao->format);
if (spa_format == SPA_AUDIO_FORMAT_UNKNOWN) {
Expand Down Expand Up @@ -228,6 +229,7 @@ static int init(struct ao *ao)

ao->device_buffer = p->buffer_samples;
snprintf(latency_str, sizeof(latency_str), "%d/%d", ao->device_buffer, ao->samplerate);
snprintf(samplerate_str, sizeof(samplerate_str), "%d", ao->samplerate);

pw_init(NULL, NULL);

Expand All @@ -247,6 +249,7 @@ static int init(struct ao *ao)
PW_KEY_APP_ID, ao->client_name,
PW_KEY_APP_ICON_NAME, ao->client_name,
PW_KEY_NODE_LATENCY, latency_str,
PW_KEY_AUDIO_RATE, samplerate_str,
NULL),
&stream_events,
ao);
Expand Down

0 comments on commit 8cabe65

Please sign in to comment.