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

Fixed replaying recordings to their very end, if they don't end with an I-frame

This commit is contained in:
Klaus Schmidinger 2016-12-22 11:40:25 +01:00
parent be4cdcf170
commit 22cb026e5e
3 changed files with 9 additions and 9 deletions

View File

@ -3330,6 +3330,7 @@ Thomas Reufer <thomas@reufer.ch>
for fixing resuming replay at a given position, which was off by one frame for fixing resuming replay at a given position, which was off by one frame
for improving handling frame numbers to have a smoother progress display during for improving handling frame numbers to have a smoother progress display during
replay of recordings with B-frames replay of recordings with B-frames
for fixing replaying recordings to their very end, if they don't end with an I-frame
Eike Sauer <EikeSauer@t-online.de> Eike Sauer <EikeSauer@t-online.de>
for reporting a problem with channels that need more than 5 TS packets for detecting for reporting a problem with channels that need more than 5 TS packets for detecting

View File

@ -8859,3 +8859,5 @@ Video Disk Recorder Revision History
to Thomas Reufer). to Thomas Reufer).
- Improved handling frame numbers to have a smoother progress display during - Improved handling frame numbers to have a smoother progress display during
replay of recordings with B-frames (thanks to Thomas Reufer). replay of recordings with B-frames (thanks to Thomas Reufer).
- Fixed replaying recordings to their very end, if they don't end with an I-frame
(thanks to Thomas Reufer).

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 4.3 2016/12/22 10:43:10 kls Exp $ * $Id: dvbplayer.c 4.4 2016/12/22 11:34:31 kls Exp $
*/ */
#include "dvbplayer.h" #include "dvbplayer.h"
@ -476,7 +476,7 @@ void cDvbPlayer::Action(void)
bool WaitingForData = false; bool WaitingForData = false;
time_t StuckAtEof = 0; time_t StuckAtEof = 0;
uint32_t LastStc = 0; uint32_t LastStc = 0;
int LastReadIFrame = -1; int LastReadFrame = -1;
int SwitchToPlayFrame = 0; int SwitchToPlayFrame = 0;
bool CutIn = false; bool CutIn = false;
bool AtLastMark = false; bool AtLastMark = false;
@ -580,12 +580,9 @@ void cDvbPlayer::Action(void)
int r = nonBlockingFileReader->Result(&b); int r = nonBlockingFileReader->Result(&b);
if (r > 0) { if (r > 0) {
WaitingForData = false; WaitingForData = false;
uint32_t Pts = 0; LastReadFrame = readIndex;
if (readIndependent) { uint32_t Pts = isPesRecording ? (PesHasPts(b) ? PesGetPts(b) : -1) : TsGetPts(b, r);
Pts = isPesRecording ? PesGetPts(b) : TsGetPts(b, r); readFrame = new cFrame(b, -r, ftUnknown, readIndex, Pts, readIndependent); // hands over b to the ringBuffer
LastReadIFrame = readIndex;
}
readFrame = new cFrame(b, -r, ftUnknown, readIndex, Pts); // hands over b to the ringBuffer
} }
else if (r < 0) { else if (r < 0) {
if (errno == EAGAIN) if (errno == EAGAIN)
@ -703,7 +700,7 @@ void cDvbPlayer::Action(void)
LastStc = Stc; LastStc = Stc;
int Index = ptsIndex.FindIndex(Stc); int Index = ptsIndex.FindIndex(Stc);
if (playDir == pdForward && !SwitchToPlayFrame) { if (playDir == pdForward && !SwitchToPlayFrame) {
if (Index >= LastReadIFrame) if (Index >= LastReadFrame)
break; // automatically stop at end of recording break; // automatically stop at end of recording
} }
else if (Index <= 0 || SwitchToPlayFrame && Index >= SwitchToPlayFrame) else if (Index <= 0 || SwitchToPlayFrame && Index >= SwitchToPlayFrame)