From 6c3fd1f07fae809fa52f640cf8e0bd643eb0838d Mon Sep 17 00:00:00 2001 From: Carlos Rafael Giani Date: Fri, 19 Jun 2026 19:18:33 +0200 Subject: [PATCH] module-rtp: Cleanup default raw / raop formats This places the default formats into a single place, which makes it easier to keep track of them. --- src/modules/module-raop-sink.c | 2 +- src/modules/module-rtp-session.c | 4 ++-- src/modules/module-rtp-sink.c | 2 +- src/modules/module-rtp-source.c | 2 +- src/modules/module-rtp/stream.c | 2 +- src/modules/module-rtp/stream.h | 3 ++- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/modules/module-raop-sink.c b/src/modules/module-raop-sink.c index af84ba3eb..ce8bdb2ce 100644 --- a/src/modules/module-raop-sink.c +++ b/src/modules/module-raop-sink.c @@ -149,7 +149,7 @@ PW_LOG_TOPIC(mod_topic, "mod." NAME); #define MAX_PORT_RETRY 128 -#define RAOP_FORMAT "S16LE" +#define RAOP_FORMAT DEFAULT_RAOP_AUDIO_FORMAT #define RAOP_STRIDE (2*DEFAULT_CHANNELS) #define RAOP_RATE 44100 #define RAOP_LATENCY_MS 250 diff --git a/src/modules/module-rtp-session.c b/src/modules/module-rtp-session.c index 4374f64b5..525ab75bc 100644 --- a/src/modules/module-rtp-session.c +++ b/src/modules/module-rtp-session.c @@ -140,7 +140,7 @@ PW_LOG_TOPIC(mod_topic, "mod." NAME); "( sess.min-ptime= ) " \ "( sess.max-ptime= ) " \ "( sess.media= ) " \ - "( audio.format= ) " \ + "( audio.format= ) " \ "( audio.rate= ) " \ "( audio.channels= ) "\ "( audio.position= ) " \ @@ -1624,7 +1624,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args) if (spa_streq(str, "audio")) { struct spa_dict_item items[] = { - { "audio.format", DEFAULT_FORMAT }, + { "audio.format", DEFAULT_RAW_AUDIO_FORMAT }, { "audio.rate", SPA_STRINGIFY(DEFAULT_RATE) }, { "audio.channels", SPA_STRINGIFY(DEFAULT_CHANNELS) }, { "audio.position", DEFAULT_POSITION } }; diff --git a/src/modules/module-rtp-sink.c b/src/modules/module-rtp-sink.c index e0d34482b..5f8c3e3d7 100644 --- a/src/modules/module-rtp-sink.c +++ b/src/modules/module-rtp-sink.c @@ -199,7 +199,7 @@ PW_LOG_TOPIC(mod_topic, "mod." NAME); "( sess.min-ptime= ) " \ "( sess.max-ptime= ) " \ "( sess.media= ) " \ - "( audio.format= ) " \ + "( audio.format= ) " \ "( audio.rate= ) " \ "( audio.channels= ) " \ "( audio.position= ) " \ diff --git a/src/modules/module-rtp-source.c b/src/modules/module-rtp-source.c index 332d126d5..f294d2c8e 100644 --- a/src/modules/module-rtp-source.c +++ b/src/modules/module-rtp-source.c @@ -174,7 +174,7 @@ PW_LOG_TOPIC(mod_topic, "mod." NAME); "( sess.latency.msec= ) "\ "( sess.ignore-ssrc= ) "\ "( sess.media= ) " \ - "( audio.format= ) " \ + "( audio.format= ) " \ "( audio.rate= ) " \ "( audio.channels= ) " \ "( audio.position= ) " \ diff --git a/src/modules/module-rtp/stream.c b/src/modules/module-rtp/stream.c index c61950978..5bbc43abc 100644 --- a/src/modules/module-rtp/stream.c +++ b/src/modules/module-rtp/stream.c @@ -613,7 +613,7 @@ static int parse_audio_info(const struct pw_properties *props, struct spa_audio_ { return spa_audio_info_raw_init_dict_keys(info, &SPA_DICT_ITEMS( - SPA_DICT_ITEM(SPA_KEY_AUDIO_FORMAT, DEFAULT_FORMAT), + SPA_DICT_ITEM(SPA_KEY_AUDIO_FORMAT, DEFAULT_RAW_AUDIO_FORMAT), SPA_DICT_ITEM(SPA_KEY_AUDIO_RATE, SPA_STRINGIFY(DEFAULT_RATE)), SPA_DICT_ITEM(SPA_KEY_AUDIO_POSITION, DEFAULT_POSITION)), &props->dict, diff --git a/src/modules/module-rtp/stream.h b/src/modules/module-rtp/stream.h index 37d041b06..94ceb3650 100644 --- a/src/modules/module-rtp/stream.h +++ b/src/modules/module-rtp/stream.h @@ -11,7 +11,8 @@ extern "C" { struct rtp_stream; -#define DEFAULT_FORMAT "S16BE" +#define DEFAULT_RAW_AUDIO_FORMAT "S16BE" +#define DEFAULT_RAOP_AUDIO_FORMAT "S16LE" #define DEFAULT_RATE 48000 #define DEFAULT_CHANNELS 2 #define DEFAULT_POSITION "[ FL FR ]"