diff options
Diffstat (limited to 'dvbplayer.c')
-rw-r--r-- | dvbplayer.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/dvbplayer.c b/dvbplayer.c index c9c8fa03..fda02158 100644 --- a/dvbplayer.c +++ b/dvbplayer.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbplayer.c 2.30 2013/02/12 10:50:10 kls Exp $ + * $Id: dvbplayer.c 2.31 2013/02/20 09:03:49 kls Exp $ */ #include "dvbplayer.h" @@ -220,6 +220,7 @@ private: cFrame *readFrame; cFrame *playFrame; cFrame *dropFrame; + bool resyncAfterPause; void TrickSpeed(int Increment); void Empty(void); bool NextFile(uint16_t FileNumber = 0, off_t FileOffset = -1); @@ -240,6 +241,7 @@ public: void SkipSeconds(int Seconds); void Goto(int Position, bool Still = false); virtual double FramesPerSecond(void) { return framesPerSecond; } + virtual void SetAudioTrack(eTrackType Type, const tTrackId *TrackId); virtual bool GetIndex(int &Current, int &Total, bool SnapToIFrame = false); virtual bool GetReplayMode(bool &Play, bool &Forward, int &Speed); }; @@ -270,6 +272,7 @@ cDvbPlayer::cDvbPlayer(const char *FileName, bool PauseLive) readFrame = NULL; playFrame = NULL; dropFrame = NULL; + resyncAfterPause = false; isyslog("replay %s", FileName); fileName = new cFileName(FileName, false, false, isPesRecording); replayFile = fileName->Open(); @@ -636,7 +639,13 @@ void cDvbPlayer::Play(void) DevicePlay(); playMode = pmPlay; playDir = pdForward; - } + if (resyncAfterPause) { + int Current, Total; + if (GetIndex(Current, Total, true)) + Goto(Current); + resyncAfterPause = false; + } + } } void cDvbPlayer::Forward(void) @@ -799,6 +808,17 @@ void cDvbPlayer::Goto(int Index, bool Still) } } +void cDvbPlayer::SetAudioTrack(eTrackType Type, const tTrackId *TrackId) +{ + if (playMode == pmPlay) { + int Current, Total; + if (GetIndex(Current, Total, true)) + Goto(Current); + } + else if (playMode == pmPause) + resyncAfterPause = true; +} + bool cDvbPlayer::GetIndex(int &Current, int &Total, bool SnapToIFrame) { if (index) { |