summaryrefslogtreecommitdiff
path: root/dvbplayer.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2009-01-25 11:39:43 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2009-01-25 11:39:43 +0100
commitf9c1974f2de4b749ffc698f72331530c3adc65ea (patch)
tree93e3291a0979bcb7dc32703d153b0c183a29837f /dvbplayer.c
parent73be47a4b1dc1b5f2628ea9b9aeb5d161363d981 (diff)
downloadvdr-f9c1974f2de4b749ffc698f72331530c3adc65ea.tar.gz
vdr-f9c1974f2de4b749ffc698f72331530c3adc65ea.tar.bz2
Improved fast-forward/-rewind for audio recordings
Diffstat (limited to 'dvbplayer.c')
-rw-r--r--dvbplayer.c20
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;