mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
media-session: use a default volume if unknown
Set a safe volume when there is no previously saved volume.
This commit is contained in:
parent
0be851739f
commit
82bc0710f0
1 changed files with 4 additions and 4 deletions
|
|
@ -320,10 +320,10 @@ static int handle_route(struct device *dev, struct sm_param *p)
|
||||||
if (dev->active_route[direction] != index) {
|
if (dev->active_route[direction] != index) {
|
||||||
const char *val = pw_properties_get(impl->to_restore, key);
|
const char *val = pw_properties_get(impl->to_restore, key);
|
||||||
dev->active_route[direction] = index;
|
dev->active_route[direction] = index;
|
||||||
if (val) {
|
if (val == NULL)
|
||||||
|
val = "{ \"volumes\": [ 0.4 ], \"mute\": false }";
|
||||||
pw_log_info("device %d: restore route '%s' to %s", dev->id, key, val);
|
pw_log_info("device %d: restore route '%s' to %s", dev->id, key, val);
|
||||||
restore_route(dev, val, index, device_id);
|
restore_route(dev, val, index, device_id);
|
||||||
}
|
|
||||||
} else if (props) {
|
} else if (props) {
|
||||||
char *val = serialize_props(dev, props);
|
char *val = serialize_props(dev, props);
|
||||||
pw_log_info("device %d: current route %s %s", dev->id, key, val);
|
pw_log_info("device %d: current route %s %s", dev->id, key, val);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue