mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-17 08:56:49 -05:00
spa: aec: webrtc: simplify webrtc_get_spa_bool()
This commit is contained in:
parent
c5bce24f01
commit
35c011b955
1 changed files with 5 additions and 7 deletions
|
|
@ -50,14 +50,12 @@ static struct spa_log_topic log_topic = SPA_LOG_TOPIC(0, "spa.eac.webrtc");
|
||||||
#undef SPA_LOG_TOPIC_DEFAULT
|
#undef SPA_LOG_TOPIC_DEFAULT
|
||||||
#define SPA_LOG_TOPIC_DEFAULT &log_topic
|
#define SPA_LOG_TOPIC_DEFAULT &log_topic
|
||||||
|
|
||||||
static bool webrtc_get_spa_bool(const struct spa_dict *args, const char *key, bool default_value) {
|
static bool webrtc_get_spa_bool(const struct spa_dict *args, const char *key, bool default_value)
|
||||||
const char *str_val;
|
{
|
||||||
bool value = default_value;
|
if (auto str = spa_dict_lookup(args, key))
|
||||||
str_val = spa_dict_lookup(args, key);
|
return spa_atob(str);
|
||||||
if (str_val != NULL)
|
|
||||||
value =spa_atob(str_val);
|
|
||||||
|
|
||||||
return value;
|
return default_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int webrtc_init(void *data, const struct spa_dict *args, const struct spa_audio_info_raw *info)
|
static int webrtc_init(void *data, const struct spa_dict *args, const struct spa_audio_info_raw *info)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue