summaryrefslogtreecommitdiff
path: root/server/menuHTTP.c
diff options
context:
space:
mode:
Diffstat (limited to 'server/menuHTTP.c')
-rw-r--r--server/menuHTTP.c19
1 files changed, 16 insertions, 3 deletions
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;
}