mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Fixed "attempt to drop wrong frame from ring buffer" when skipping +/- one minute during replay
This commit is contained in:
parent
42928ff2d3
commit
6564d8e928
2
HISTORY
2
HISTORY
@ -6406,3 +6406,5 @@ Video Disk Recorder Revision History
|
|||||||
- Changed the polarization characters in cDvbSourceParam::GetOsdItem() to uppercase.
|
- Changed the polarization characters in cDvbSourceParam::GetOsdItem() to uppercase.
|
||||||
- The full timer file name is now displayed if it ends with "TITLE" or "EPISODE"
|
- The full timer file name is now displayed if it ends with "TITLE" or "EPISODE"
|
||||||
(pointed out by Udo Richter).
|
(pointed out by Udo Richter).
|
||||||
|
- Fixed "attempt to drop wrong frame from ring buffer" when skipping +/- one minute
|
||||||
|
during replay.
|
||||||
|
16
dvbplayer.c
16
dvbplayer.c
@ -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.20 2010/02/06 12:34:28 kls Exp $
|
* $Id: dvbplayer.c 2.21 2010/03/07 14:24:26 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dvbplayer.h"
|
#include "dvbplayer.h"
|
||||||
@ -218,6 +218,7 @@ private:
|
|||||||
bool readIndependent;
|
bool readIndependent;
|
||||||
cFrame *readFrame;
|
cFrame *readFrame;
|
||||||
cFrame *playFrame;
|
cFrame *playFrame;
|
||||||
|
cFrame *dropFrame;
|
||||||
void TrickSpeed(int Increment);
|
void TrickSpeed(int Increment);
|
||||||
void Empty(void);
|
void Empty(void);
|
||||||
bool NextFile(uint16_t FileNumber = 0, off_t FileOffset = -1);
|
bool NextFile(uint16_t FileNumber = 0, off_t FileOffset = -1);
|
||||||
@ -266,6 +267,7 @@ cDvbPlayer::cDvbPlayer(const char *FileName)
|
|||||||
readIndependent = false;
|
readIndependent = false;
|
||||||
readFrame = NULL;
|
readFrame = NULL;
|
||||||
playFrame = NULL;
|
playFrame = NULL;
|
||||||
|
dropFrame = NULL;
|
||||||
isyslog("replay %s", FileName);
|
isyslog("replay %s", FileName);
|
||||||
fileName = new cFileName(FileName, false, false, isPesRecording);
|
fileName = new cFileName(FileName, false, false, isPesRecording);
|
||||||
replayFile = fileName->Open();
|
replayFile = fileName->Open();
|
||||||
@ -322,6 +324,7 @@ void cDvbPlayer::Empty(void)
|
|||||||
delete readFrame; // might not have been stored in the buffer in Action()
|
delete readFrame; // might not have been stored in the buffer in Action()
|
||||||
readFrame = NULL;
|
readFrame = NULL;
|
||||||
playFrame = NULL;
|
playFrame = NULL;
|
||||||
|
dropFrame = NULL;
|
||||||
ringBuffer->Clear();
|
ringBuffer->Clear();
|
||||||
ptsIndex.Clear();
|
ptsIndex.Clear();
|
||||||
DeviceClear();
|
DeviceClear();
|
||||||
@ -396,7 +399,6 @@ 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)
|
||||||
@ -503,10 +505,10 @@ void cDvbPlayer::Action(void)
|
|||||||
else
|
else
|
||||||
Sleep = true;
|
Sleep = true;
|
||||||
|
|
||||||
if (DropFrame) {
|
if (dropFrame) {
|
||||||
if (!eof || (playDir != pdForward && DropFrame->Index() > 0) || (playDir == pdForward && DropFrame->Index() < readIndex)) {
|
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
|
ringBuffer->Drop(dropFrame); // the very first and last frame are continously repeated to flush data through the device
|
||||||
DropFrame = NULL;
|
dropFrame = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -554,7 +556,7 @@ void cDvbPlayer::Action(void)
|
|||||||
Sleep = true;
|
Sleep = true;
|
||||||
}
|
}
|
||||||
if (pc <= 0) {
|
if (pc <= 0) {
|
||||||
DropFrame = playFrame;
|
dropFrame = playFrame;
|
||||||
playFrame = NULL;
|
playFrame = NULL;
|
||||||
p = NULL;
|
p = NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user