diff options
-rw-r--r-- | httptnt/resourceStreamer.ecpp | 9 | ||||
-rw-r--r-- | media/pluginManager.cpp | 2 | ||||
-rw-r--r-- | plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp | 9 |
3 files changed, 16 insertions, 4 deletions
diff --git a/httptnt/resourceStreamer.ecpp b/httptnt/resourceStreamer.ecpp index 5d26a43..d83e0d4 100644 --- a/httptnt/resourceStreamer.ecpp +++ b/httptnt/resourceStreamer.ecpp @@ -17,6 +17,9 @@ int resourceID = 0; using namespace upnp; </%pre> +<%request> + boost::shared_ptr<cResourceStreamer> streamer; +</%request> <# int doRequest(tnt::HttpReply reply, tnt::HttpRequest request, std::string objectID, int resourceID) { #> @@ -28,7 +31,7 @@ int doRequest(tnt::HttpReply reply, tnt::HttpRequest request, std::string object cMediaServer* server = cMediaServer::GetInstance(); cMediaManager& manager = server->GetManager(); - boost::shared_ptr<cResourceStreamer> streamer(manager.GetResourceStreamer(objectID, resourceID)); + streamer = boost::shared_ptr<cResourceStreamer>(manager.GetResourceStreamer(objectID, resourceID)); if(!streamer.get()){ reply.out() << "Object ID not found or invalid"; @@ -55,8 +58,8 @@ int doRequest(tnt::HttpReply reply, tnt::HttpRequest request, std::string object if(rangeRequest.find("bytes=",0) == 0){ unsigned int minus = rangeRequest.find_first_of('-',6); if(minus != std::string::npos){ - from = atoi(rangeRequest.substr(6, minus - 6).c_str()); - to = atoi(rangeRequest.substr(minus + 1).c_str()); + from = atol(rangeRequest.substr(6, minus - 6).c_str()); + to = atol(rangeRequest.substr(minus + 1).c_str()); if(from){ // If range is off the road, reset it to correct values. if(from <= 0 || from > contentLength) from = 0; diff --git a/media/pluginManager.cpp b/media/pluginManager.cpp index 1a36b4d..8cde797 100644 --- a/media/pluginManager.cpp +++ b/media/pluginManager.cpp @@ -405,7 +405,7 @@ bool upnp::cPluginManager::DLL::Load(){ return true; } } else { - cerr << "Error while opening plugin: " << error << endl; + esyslog("UPnP\tError while opening plugin: %s", error); } return false; diff --git a/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp b/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp index 6a8485d..89f9be6 100644 --- a/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp +++ b/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp @@ -128,6 +128,8 @@ private: DLNA_PLAYSPEEDS_NONE, DLNA_CONVERSION_NONE, DLNA_FLAG_STREAMING_TRANSFER | DLNA_FLAG_BYTE_BASED_SEEK | + DLNA_FLAG_BACKGROUND_TRANSFER | + DLNA_FLAG_CONNECTION_STALLING | DLNA_FLAG_VERSION_1_5 ); break; case 0x1B: @@ -135,6 +137,8 @@ private: DLNA_PLAYSPEEDS_NONE, DLNA_CONVERSION_NONE, DLNA_FLAG_STREAMING_TRANSFER | DLNA_FLAG_BYTE_BASED_SEEK | + DLNA_FLAG_BACKGROUND_TRANSFER | + DLNA_FLAG_CONNECTION_STALLING | DLNA_FLAG_VERSION_1_5 ); break; default: @@ -145,6 +149,11 @@ private: resource.SetResourceUri(u); resource.SetProtocolInfo(ProtocolInfo("video/mpeg", fourthfield).ToString()); + if(recording->LengthInSeconds()){ + boost::posix_time::time_duration duration = boost::posix_time::seconds(recording->LengthInSeconds()); + resource.SetDuration(boost::posix_time::to_simple_string(duration)); + } + metadata.AddResource(resource); return true; |