From 0deea38705627533ab074d51247d37b7a783606a Mon Sep 17 00:00:00 2001 From: methodus Date: Mon, 29 Oct 2012 01:13:45 +0100 Subject: Fixed compile error when building against VDR 1.7.20 and older --- plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp b/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp index 1a83f54..07f4fb4 100644 --- a/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp +++ b/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp @@ -149,10 +149,17 @@ private: resource.SetResourceUri(u); resource.SetProtocolInfo(ProtocolInfo("video/mpeg", fourthfield).ToString()); - if(recording->LengthInSeconds() > 0){ + int duration = 0; + cEvent* event = NULL; + if((event = info->GetEvent()) && event->Duration() > 0){ + duration = event->Duration(); + } +#if VDRVERSNUM > 10723 + else if(recording->LengthInSeconds() > 0){ boost::posix_time::time_duration duration = boost::posix_time::seconds(recording->LengthInSeconds()); resource.SetDuration(boost::posix_time::to_simple_string(duration)); } +#endif metadata.AddResource(resource); -- cgit v1.2.3