summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorFrank Schmirler <vdr@schmirler.de>2014-09-08 22:35:18 +0200
committerFrank Schmirler <vdr@schmirler.de>2014-09-08 22:35:18 +0200
commit58f0348578da0707ae83deb433d6e7c5f01577c1 (patch)
tree5d99c67494ccda69785db5bf9b6e235fa1fd0196 /server
parente83c9d92aa1c4a83e2fb9d2474e09dfd78be33ef (diff)
downloadvdr-plugin-streamdev-58f0348578da0707ae83deb433d6e7c5f01577c1.tar.gz
vdr-plugin-streamdev-58f0348578da0707ae83deb433d6e7c5f01577c1.tar.bz2
Show old VDR PES recordings in HTTP menu only if PES mode is selected
Diffstat (limited to 'server')
-rw-r--r--server/connectionHTTP.c2
-rw-r--r--server/menuHTTP.c19
-rw-r--r--server/menuHTTP.h5
3 files changed, 21 insertions, 5 deletions
diff --git a/server/connectionHTTP.c b/server/connectionHTTP.c
index 517fb2e..bec9bef 100644
--- a/server/connectionHTTP.c
+++ b/server/connectionHTTP.c
@@ -468,7 +468,7 @@ cMenuList* cConnectionHTTP::MenuListFromString(const std::string& Path, const st
(Filebase.empty() && Fileext.empty())) {
iterator = new cListAll();
} else if (Filebase.compare("recordings") == 0) {
- iterator = new cRecordingsIterator();
+ iterator = new cRecordingsIterator(m_StreamType);
}
if (iterator) {
diff --git a/server/menuHTTP.c b/server/menuHTTP.c
index e512c4b..05315ea 100644
--- a/server/menuHTTP.c
+++ b/server/menuHTTP.c
@@ -6,12 +6,25 @@
#include "server/menuHTTP.h"
//**************************** cRecordingIterator **************
-cRecordingsIterator::cRecordingsIterator(): RecordingsLock(&Recordings)
+cRecordingsIterator::cRecordingsIterator(eStreamType StreamType): RecordingsLock(&Recordings)
{
- first = Recordings.First();
+ streamType = StreamType;
+ first = NextSuitable(Recordings.First());
current = NULL;
}
+const cRecording* cRecordingsIterator::NextSuitable(const cRecording *Recording)
+{
+ while (Recording)
+ {
+ bool isPes = Recording->IsPesRecording();
+ if (!isPes || (isPes && streamType == stPES))
+ break;
+ Recording = Recordings.Next(Recording);
+ }
+ return Recording;
+}
+
bool cRecordingsIterator::Next()
{
if (first)
@@ -20,7 +33,7 @@ bool cRecordingsIterator::Next()
first = NULL;
}
else
- current = Recordings.Next(current);
+ current = NextSuitable(Recordings.Next(current));
return current;
}
diff --git a/server/menuHTTP.h b/server/menuHTTP.h
index 2a396d4..91a00b1 100644
--- a/server/menuHTTP.h
+++ b/server/menuHTTP.h
@@ -24,9 +24,12 @@ class cItemIterator
class cRecordingsIterator: public cItemIterator
{
private:
+ eStreamType streamType;
const cRecording *first;
const cRecording *current;
cThreadLock RecordingsLock;
+ protected:
+ virtual const cRecording* NextSuitable(const cRecording *Recording);
public:
virtual bool Next();
virtual bool IsGroup() const { return false; }
@@ -35,7 +38,7 @@ class cRecordingsIterator: public cItemIterator
virtual const cString ItemRessource() const;
virtual const char* Alang(int i) const { return NULL; }
virtual const char* Dlang(int i) const { return NULL; }
- cRecordingsIterator();
+ cRecordingsIterator(eStreamType StreamType);
virtual ~cRecordingsIterator() {};
};