diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2009-01-25 11:39:43 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2009-01-25 11:39:43 +0100 |
commit | f9c1974f2de4b749ffc698f72331530c3adc65ea (patch) | |
tree | 93e3291a0979bcb7dc32703d153b0c183a29837f /dvbplayer.c | |
parent | 73be47a4b1dc1b5f2628ea9b9aeb5d161363d981 (diff) | |
download | vdr-f9c1974f2de4b749ffc698f72331530c3adc65ea.tar.gz vdr-f9c1974f2de4b749ffc698f72331530c3adc65ea.tar.bz2 |
Improved fast-forward/-rewind for audio recordings
Diffstat (limited to 'dvbplayer.c')
-rw-r--r-- | dvbplayer.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/dvbplayer.c b/dvbplayer.c index 9e3cd2fd..6e004403 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.2 2009/01/24 11:42:07 kls Exp $ + * $Id: dvbplayer.c 2.3 2009/01/25 11:11:39 kls Exp $ */ #include "dvbplayer.h" @@ -412,8 +412,12 @@ void cDvbPlayer::Action(void) if (index->Get(readIndex + 1, &FileNumber, &FileOffset, NULL, &Length)) Index = readIndex + 1; } - else - Index = index->GetNextIFrame(readIndex, playDir == pdForward, &FileNumber, &FileOffset, &Length, TimeShiftMode); + else { + int d = int(round(0.4 * framesPerSecond)); + if (playDir != pdForward) + d = -d; + Index = index->GetNextIFrame(readIndex + d, playDir == pdForward, &FileNumber, &FileOffset, &Length, TimeShiftMode); + } if (Index >= 0) { if (!NextFile(FileNumber, FileOffset)) { readIndex = Index; @@ -516,9 +520,9 @@ void cDvbPlayer::Action(void) if (p) { int w; if (isPesRecording) - w = PlayPes(p, pc, playMode != pmPlay); + w = PlayPes(p, pc, playMode != pmPlay && DeviceIsPlayingVideo()); else - w = PlayTs(p, TS_SIZE, playMode != pmPlay); + w = PlayTs(p, TS_SIZE, playMode != pmPlay && DeviceIsPlayingVideo()); if (w > 0) { p += w; pc -= w; @@ -593,7 +597,8 @@ void cDvbPlayer::Forward(void) LOCK_THREAD; if (!(DeviceHasIBPTrickSpeed() && playDir == pdForward)) Empty(); - DeviceMute(); + if (DeviceIsPlayingVideo()) + DeviceMute(); playMode = pmFast; playDir = pdForward; trickSpeed = NORMAL_SPEED; @@ -639,7 +644,8 @@ void cDvbPlayer::Backward(void) case pmPlay: { LOCK_THREAD; Empty(); - DeviceMute(); + if (DeviceIsPlayingVideo()) + DeviceMute(); playMode = pmFast; playDir = pdBackward; trickSpeed = NORMAL_SPEED; |