summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchriszero <zerov83@gmail.com>2015-03-11 20:02:09 +0100
committerchriszero <zerov83@gmail.com>2015-03-11 20:02:09 +0100
commit5989d80e8022f5b5796ce168919e49f9400475b2 (patch)
tree1ab11548195eb8ae4e237974ab0606bf6b8a1847
parenteb49ddb616958c42357db216c721a5211abc7659 (diff)
downloadvdr-plugin-plex-5989d80e8022f5b5796ce168919e49f9400475b2.tar.gz
vdr-plugin-plex-5989d80e8022f5b5796ce168919e49f9400475b2.tar.bz2
Fixes crash when casting other media than video0.1.3
-rw-r--r--PlexHTTPRequestHandler.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/PlexHTTPRequestHandler.cpp b/PlexHTTPRequestHandler.cpp
index 4de66f1..5339258 100644
--- a/PlexHTTPRequestHandler.cpp
+++ b/PlexHTTPRequestHandler.cpp
@@ -227,13 +227,16 @@ void PlayerRequestHandler::handleRequest(Poco::Net::HTTPServerRequest& request,
std::string fullUrl = protocol + "://" + address + ":" + port + key; // Metainfo
std::cout << fullUrl << std::endl;
MediaContainer Cont = Plexservice::GetMediaContainer(fullUrl);
-
- // MUSS im Maintread des Plugins/VDR gestartet werden
- if(query.find("offset") != query.end()) {
- Cont.m_vVideos[0].m_iMyPlayOffset = atoi(query["offset"].c_str()) / 1000;
- }
- ActionManager::GetInstance().AddAction(Cont.m_vVideos[0]);
+ // Check for video
+ if(Cont.m_vVideos.size() > 0) {
+ // MUSS im Maintread des Plugins/VDR gestartet werden
+ if(query.find("offset") != query.end()) {
+ Cont.m_vVideos[0].m_iMyPlayOffset = atoi(query["offset"].c_str()) / 1000;
+ }
+
+ ActionManager::GetInstance().AddAction(Cont.m_vVideos[0]);
+ }
} else if(request.getURI().find("/playback/play") != std::string::npos) {
cRemote::Put(kPlay);
} else if(request.getURI().find("/playback/pause") != std::string::npos) {