summaryrefslogtreecommitdiff
path: root/PlexHTTPRequestHandler.cpp
diff options
context:
space:
mode:
authorchriszero <zerov83@gmail.com>2015-02-13 16:14:10 +0100
committerchriszero <zerov83@gmail.com>2015-02-13 16:14:10 +0100
commit20fefdd3f341d6e7f6b15e4926bf5569aa1943d5 (patch)
treeba402770b4912be3d93f6dd8faab521f4b5e4762 /PlexHTTPRequestHandler.cpp
parentb5c156939ddf2fc4ec3fa27ae1c3daae28681c12 (diff)
downloadvdr-plugin-plex-20fefdd3f341d6e7f6b15e4926bf5569aa1943d5.tar.gz
vdr-plugin-plex-20fefdd3f341d6e7f6b15e4926bf5569aa1943d5.tar.bz2
Removed some raw pointers to avoid a possible memoryleak
Diffstat (limited to 'PlexHTTPRequestHandler.cpp')
-rw-r--r--PlexHTTPRequestHandler.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/PlexHTTPRequestHandler.cpp b/PlexHTTPRequestHandler.cpp
index f07bce4..86ac3cd 100644
--- a/PlexHTTPRequestHandler.cpp
+++ b/PlexHTTPRequestHandler.cpp
@@ -3,6 +3,8 @@
#include <vdr/keys.h>
#include <unistd.h>
+#include <Poco/SharedPtr.h>
+
#include "hlsPlayerControl.h"
namespace plexclient
@@ -224,16 +226,17 @@ void PlayerRequestHandler::handleRequest(Poco::Net::HTTPServerRequest& request,
std::string address = query["address"];
std::string port = query["port"];
std::string key = query["key"];
-
+
std::string fullUrl = protocol + "://" + address + ":" + port + key; // Metainfo
std::cout << fullUrl << std::endl;
- MediaContainer* pCont = Plexservice::GetMediaContainer(fullUrl);
+ MediaContainer Cont = Plexservice::GetMediaContainer(fullUrl);
// MUSS im Maintread des Plugins/VDR gestartet werden
if(query.find("offset") != query.end()) {
- pCont->m_vVideos[0].m_iMyPlayOffset = atoi(query["offset"].c_str()) / 1000;
+ Cont.m_vVideos[0].m_iMyPlayOffset = atoi(query["offset"].c_str()) / 1000;
}
- ActionManager::GetInstance().AddAction(&pCont->m_vVideos[0]); // MemoryLeak?
+ //Poco::
+ 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) {