Try to autoselect a non-selected raop device if no valid output was

selected. This should make life easier for users of Remote on iPhone
where speakers can only be selected after playback has started (I
think...)
This commit is contained in:
ejurgensen 2014-01-13 23:24:45 +01:00
parent 827c8c787e
commit ae51922f57

View File

@ -2371,6 +2371,28 @@ playback_start(struct player_command *cmd)
} }
} }
/* Try to autoselect a non-selected RAOP device if the above failed */
if ((laudio_status == LAUDIO_CLOSED) && (cmd->raop_pending == 0) && (raop_sessions == 0))
for (rd = dev_list; rd; rd = rd->next)
{
if (!rd->session)
{
speaker_select_raop(rd);
ret = raop_device_start(rd, device_restart_cb, last_rtptime + AIRTUNES_V2_PACKET_SAMPLES);
if (ret < 0)
{
DPRINTF(E_DBG, L_PLAYER, "Could not autoselect AirTunes device %s\n", rd->name);
speaker_deselect_raop(rd);
continue;
}
DPRINTF(E_INFO, L_PLAYER, "Autoselecting AirTunes device %s\n", rd->name);
cmd->raop_pending++;
break;
}
}
/* No luck finding valid output */
if ((laudio_status == LAUDIO_CLOSED) && (cmd->raop_pending == 0) && (raop_sessions == 0)) if ((laudio_status == LAUDIO_CLOSED) && (cmd->raop_pending == 0) && (raop_sessions == 0))
{ {
DPRINTF(E_LOG, L_PLAYER, "Could not start playback: no output selected or couldn't start any output\n"); DPRINTF(E_LOG, L_PLAYER, "Could not start playback: no output selected or couldn't start any output\n");