21 #define PTSINDEX_ENTRIES 500
37 void Put(uint32_t Pts,
int Index);
74 uint32_t Delta = 0xFFFFFFFF;
76 for (
int i =
w; i !=
r; ) {
115 :
cThread(
"non blocking file reader")
201 #define PLAYERBUFSIZE MEGABYTE(1)
203 #define RESUMEBACKUP 10 // number of seconds to back up when resuming an interrupted replay session
204 #define MAXSTUCKATEOF 3 // max. number of seconds to wait in case the device doesn't play the last frame
233 bool NextFile(uint16_t FileNumber = 0, off_t FileOffset = -1);
238 virtual void Action(
void);
240 cDvbPlayer(
const char *FileName,
bool PauseLive);
249 void Goto(
int Position,
bool Still =
false);
252 virtual bool GetIndex(
int &Current,
int &Total,
bool SnapToIFrame =
false);
256 #define MAX_VIDEO_SLOWMOTION 63 // max. arg to pass to VIDEO_SLOWMOTION // TODO is this value correct?
257 #define NORMAL_SPEED 4 // the index of the '1' entry in the following array
258 #define MAX_SPEEDS 3 // the offset of the maximum speed from normal speed in either direction
259 #define SPEED_MULT 12 // the speed multiplier
283 isyslog(
"replay %s", FileName);
292 esyslog(
"ERROR: can't allocate index");
365 if (
index->
Get(Index, &FileNumber, &FileOffset) &&
NextFile(FileNumber, FileOffset))
416 bool WaitingForData =
false;
417 time_t StuckAtEof = 0;
418 uint32_t LastStc = 0;
419 int LastReadIFrame = -1;
420 int SwitchToPlayFrame = 0;
457 if (NewIndex <= 0 && readIndex > 0)
467 if (!
NextFile(FileNumber, FileOffset))
496 WaitingForData =
false;
506 WaitingForData =
true;
570 w =
PlayTs(p, pc, VideoOnly);
591 if (
eof || SwitchToPlayFrame) {
592 bool SwitchToPlay =
false;
596 else if (!StuckAtEof)
597 StuckAtEof = time(NULL);
606 if (Index >= LastReadIFrame)
609 else if (Index <= 0 || SwitchToPlayFrame && Index >= SwitchToPlayFrame)
612 if (!SwitchToPlayFrame)
617 SwitchToPlayFrame = 0;
708 default:
esyslog(
"ERROR: unknown playMode %d (%s)",
playMode, __FUNCTION__);
760 default:
esyslog(
"ERROR: unknown playMode %d (%s)",
playMode, __FUNCTION__);
767 if (
index && Frames) {
770 int OldCurrent = Current;
775 return Current >= 0 ? Current : OldCurrent;
782 if (
index && Seconds) {
808 if (Index >= 0 &&
NextFile(FileNumber, FileOffset) && Still) {
845 Current = (abs(Current - i1) <= abs(Current - i2)) ? i1 : i2;
850 Current = Total = -1;