Permalink
Browse files

upnp: issue Stop before SetAVTransportURI to make sure it's stopped

Renderers should reject this call if not stopped according to
DLNA
  • Loading branch information...
1 parent 9f1f356 commit c1fd6725c9f8454f6d356b1a3a59830cd14315ae @elupus committed Nov 3, 2012
Showing with 10 additions and 0 deletions.
  1. +10 −0 xbmc/network/upnp/UPnPPlayer.cpp
@@ -197,6 +197,16 @@ bool CUPnPPlayer::OpenFile(const CFileItem& file, const CPlayerOptions& options)
NPT_Cardinal res_index;
NPT_CHECK_LABEL_SEVERE(m_control->FindBestResource(m_delegate->m_device, *obj, res_index), failed);
+
+ /* dlna specifies that a return code of 705 should be returned
+ * if TRANSPORT_STATE is not STOPPED or NO_MEDIA_PRESENT */
+ NPT_CHECK_LABEL_SEVERE(m_control->Stop(m_delegate->m_device
+ , m_delegate->m_instance
+ , m_delegate), failed);
+ if(!m_delegate->m_resevent.WaitMSec(10000)) goto failed;
+ NPT_CHECK_LABEL_SEVERE(m_delegate->m_resstatus, failed);
+
+
NPT_CHECK_LABEL_SEVERE(m_control->SetAVTransportURI(m_delegate->m_device
, m_delegate->m_instance
, obj->m_Resources[res_index].m_Uri

0 comments on commit c1fd672

Please sign in to comment.