summaryrefslogtreecommitdiff
path: root/hlsPlayerControl.cpp
diff options
context:
space:
mode:
authorchriszero <zerov83@gmail.com>2015-05-20 21:18:14 +0200
committerchriszero <zerov83@gmail.com>2015-05-20 21:18:14 +0200
commit709ebb92273ae0af7aae79dfeb55e3ddf17324af (patch)
treeadf10eeaa71b65dfd5343c8d8c31b5728ec334b1 /hlsPlayerControl.cpp
parent86cfa7fa64406971990160db56b71c7a71dcf3e5 (diff)
downloadvdr-plugin-plex-709ebb92273ae0af7aae79dfeb55e3ddf17324af.tar.gz
vdr-plugin-plex-709ebb92273ae0af7aae79dfeb55e3ddf17324af.tar.bz2
- Added handling for disapearing or not reachable plexservers
Diffstat (limited to 'hlsPlayerControl.cpp')
-rw-r--r--hlsPlayerControl.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/hlsPlayerControl.cpp b/hlsPlayerControl.cpp
index f2348f5..d8d847d 100644
--- a/hlsPlayerControl.cpp
+++ b/hlsPlayerControl.cpp
@@ -23,11 +23,12 @@ cControl* cHlsPlayerControl::Create(plexclient::Video Video)
// get Metadata
std::string uri = Video.m_pServer->GetUri() + Video.m_sKey;
- plexclient::MediaContainer pmcontainer = plexclient::Plexservice::GetMediaContainer(uri);
-
- std::string transcodeUri = plexclient::Plexservice::GetUniversalTranscodeUrl(&pmcontainer.m_vVideos[0], Video.m_iMyPlayOffset);
- cHlsPlayerControl* playerControl = new cHlsPlayerControl(new cHlsPlayer(transcodeUri, pmcontainer.m_vVideos[0], Video.m_iMyPlayOffset), pmcontainer.m_vVideos[0]);
- playerControl->m_title = pmcontainer.m_vVideos[0].m_sTitle;
+ auto pmcontainer = plexclient::Plexservice::GetMediaContainer(uri);
+ if(pmcontainer == NULL) return NULL;
+
+ std::string transcodeUri = plexclient::Plexservice::GetUniversalTranscodeUrl(&pmcontainer->m_vVideos[0], Video.m_iMyPlayOffset);
+ cHlsPlayerControl* playerControl = new cHlsPlayerControl(new cHlsPlayer(transcodeUri, pmcontainer->m_vVideos[0], Video.m_iMyPlayOffset), pmcontainer->m_vVideos[0]);
+ playerControl->m_title = pmcontainer->m_vVideos[0].m_sTitle;
return playerControl;
}