pipewire: module-roc-{sink,source}: pass 0 to pw_properties_get_uint32()

There is no reason to use `data->rate` as the default value
since it will be zero, so just pass 0 explicitly.
This commit is contained in:
Barnabás Pőcze 2023-11-22 19:44:26 +01:00
parent 0a3bd825cd
commit 68c0a13694
2 changed files with 2 additions and 2 deletions

View file

@ -402,7 +402,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
if ((str = pw_properties_get(capture_props, PW_KEY_MEDIA_CLASS)) == NULL) if ((str = pw_properties_get(capture_props, PW_KEY_MEDIA_CLASS)) == NULL)
pw_properties_set(capture_props, PW_KEY_MEDIA_CLASS, "Audio/Sink"); pw_properties_set(capture_props, PW_KEY_MEDIA_CLASS, "Audio/Sink");
data->rate = pw_properties_get_uint32(capture_props, PW_KEY_AUDIO_RATE, data->rate); data->rate = pw_properties_get_uint32(capture_props, PW_KEY_AUDIO_RATE, 0);
if (data->rate == 0) if (data->rate == 0)
data->rate = PW_ROC_DEFAULT_RATE; data->rate = PW_ROC_DEFAULT_RATE;

View file

@ -425,7 +425,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
if (pw_properties_get(playback_props, PW_KEY_NODE_NETWORK) == NULL) if (pw_properties_get(playback_props, PW_KEY_NODE_NETWORK) == NULL)
pw_properties_set(playback_props, PW_KEY_NODE_NETWORK, "true"); pw_properties_set(playback_props, PW_KEY_NODE_NETWORK, "true");
data->rate = pw_properties_get_uint32(playback_props, PW_KEY_AUDIO_RATE, data->rate); data->rate = pw_properties_get_uint32(playback_props, PW_KEY_AUDIO_RATE, 0);
if (data->rate == 0) if (data->rate == 0)
data->rate = PW_ROC_DEFAULT_RATE; data->rate = PW_ROC_DEFAULT_RATE;