1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Improved handling frames at the beginning and end of a recording in cDvbPlayer for devices with large buffers

This commit is contained in:
Klaus Schmidinger 2010-02-06 12:43:16 +01:00
parent cabf18db73
commit 2517b2ee8d
3 changed files with 14 additions and 3 deletions

View File

@ -1244,6 +1244,8 @@ Reinhard Nissl <rnissl@gmx.de>
for reporting a bug in storing the current OSD size in case the for reporting a bug in storing the current OSD size in case the
device has changed it in its setup menu device has changed it in its setup menu
for increasing the value of MAXFRAMESIZE to better suit HD recordings for increasing the value of MAXFRAMESIZE to better suit HD recordings
for improving handling frames at the beginning and end of a recording in cDvbPlayer
for devices with large buffers
Richard Robson <richard_robson@beeb.net> Richard Robson <richard_robson@beeb.net>
for reporting freezing replay if a timer starts while in Transfer Mode from the for reporting freezing replay if a timer starts while in Transfer Mode from the

View File

@ -6317,3 +6317,5 @@ Video Disk Recorder Revision History
- Moved the declaration of cMenuCommands to menu.h, so that plugins can use it. - Moved the declaration of cMenuCommands to menu.h, so that plugins can use it.
- Added a note to the MANUAL, saying that adding new transponders only works if the - Added a note to the MANUAL, saying that adding new transponders only works if the
"EPG scan" is active (suggested by Halim Sahim). "EPG scan" is active (suggested by Halim Sahim).
- Improved handling frames at the beginning and end of a recording in cDvbPlayer for
devices with large buffers (thanks to Reinhard Nissl).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: dvbplayer.c 2.19 2009/12/13 13:49:56 kls Exp $ * $Id: dvbplayer.c 2.20 2010/02/06 12:34:28 kls Exp $
*/ */
#include "dvbplayer.h" #include "dvbplayer.h"
@ -396,6 +396,7 @@ void cDvbPlayer::Action(void)
uint32_t LastStc = 0; uint32_t LastStc = 0;
int LastReadIFrame = -1; int LastReadIFrame = -1;
int SwitchToPlayFrame = 0; int SwitchToPlayFrame = 0;
cFrame *DropFrame = NULL;
while (Running()) { while (Running()) {
if (WaitingForData) if (WaitingForData)
@ -502,6 +503,13 @@ void cDvbPlayer::Action(void)
else else
Sleep = true; Sleep = true;
if (DropFrame) {
if (!eof || (playDir != pdForward && DropFrame->Index() > 0) || (playDir == pdForward && DropFrame->Index() < readIndex)) {
ringBuffer->Drop(DropFrame); // the very first and last frame are continously repeated to flush data through the device
DropFrame = NULL;
}
}
// Get the next frame from the buffer: // Get the next frame from the buffer:
if (!playFrame) { if (!playFrame) {
@ -546,8 +554,7 @@ void cDvbPlayer::Action(void)
Sleep = true; Sleep = true;
} }
if (pc <= 0) { if (pc <= 0) {
if (!eof || (playDir != pdForward && playFrame->Index() > 0) || (playDir == pdForward && playFrame->Index() < readIndex)) DropFrame = playFrame;
ringBuffer->Drop(playFrame); // the very first and last frame are continously repeated to flush data through the device
playFrame = NULL; playFrame = NULL;
p = NULL; p = NULL;
} }