[player] Migrate a lot of speaker handling to outputs.c

Moves speaker selection, volume handling and startup to outputs.c, plus adds
the ability to "resurrect" a speaker that disconnects.

The purpose of moving the code is to concentrate device handling in one place.

Also changes how we deal with speaker selection. The player will now generally
not alter a user selection, even if the device fails. The purpose of this is to
maintain selection both if the device briefly fails, and if the user switches
off the device (we stop playback) and later turns it on + starts new playback.
This commit is contained in:
ejurgensen
2020-05-01 20:11:45 +02:00
parent d0738aabae
commit 661289990c
10 changed files with 476 additions and 573 deletions

View File

@@ -1932,7 +1932,7 @@ cast_device_start_generic(struct output_device *device, int callback_id, cast_re
cast_session_cleanup(cs);
}
else
return 0;
return 1;
}
cs = cast_session_make(device, AF_INET, callback_id);
@@ -1950,7 +1950,7 @@ cast_device_start_generic(struct output_device *device, int callback_id, cast_re
return -1;
}
return 0;
return 1;
}
static int
@@ -1974,7 +1974,7 @@ cast_device_stop(struct output_device *device, int callback_id)
cast_session_shutdown(cs, CAST_STATE_NONE);
return 0;
return 1;
}
static int
@@ -1986,7 +1986,7 @@ cast_device_flush(struct output_device *device, int callback_id)
cs->state = CAST_STATE_MEDIA_CONNECTED;
cast_status(cs);
return 0;
return 1;
}
static void