Commit 66a200ae authored by Jean-Francois Dockes's avatar Jean-Francois Dockes
Browse files

avtransport mode: seek after a gapless transition would result in trying to...

avtransport mode: seek after a gapless transition would result in trying to insert a track at pos 1 in empty MPD list, and error. Esp. manifested itself with Sonore bridge and LMS
parent 7dd3a898
......@@ -394,14 +394,6 @@ int UpMpdAVTransport::setAVTransportURI(const SoapIncoming& sc, SoapOutgoing& da
return UPNP_E_INVALID_PARAM;
}
if ((m_dev->m_options & UpMpd::upmpdOwnQueue) && !setnext) {
// If we own the queue, just clear it before setting the
// track. Else it's difficult to impossible to prevent it
// from growing if upmpdcli restarts. If the option is not set, the
// user prefers to live with the issue.
m_dev->m_mpdcli->clearQueue();
}
bool is_song = (st == MpdStatus::MPDS_PLAY) ||
(st == MpdStatus::MPDS_PAUSE);
UPMPD_UNUSED(is_song);
......@@ -410,6 +402,16 @@ int UpMpdAVTransport::setAVTransportURI(const SoapIncoming& sc, SoapOutgoing& da
"AVTransportURI: curpos: " <<
curpos << " is_song " << is_song << " qlen " << mpds.qlen << endl);
if ((m_dev->m_options & UpMpd::upmpdOwnQueue) && !setnext) {
// If we own the queue, just clear it before setting the
// track. Else it's difficult to impossible to prevent it
// from growing if upmpdcli restarts. If the option is not set, the
// user prefers to live with the issue.
m_dev->m_mpdcli->clearQueue();
// mpds is now invalid!
curpos = -1;
}
// curpos == -1 means that the playlist was cleared or we just started. A
// play will use position 0, so it's actually equivalent to curpos == 0
if (curpos == -1) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment