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

The frame detector now only starts collecting PTS values after it has seen the first I-frame

This commit is contained in:
Klaus Schmidinger 2011-06-11 11:40:18 +02:00
parent b226ab46d6
commit c90e87d71f
3 changed files with 7 additions and 2 deletions

View File

@ -2572,6 +2572,8 @@ Derek Kelly (user.vdr@gmail.com)
for reporting a problem where the frame rate was not detected correctly for reporting a problem where the frame rate was not detected correctly
for testing the implementation of FE_CAN_TURBO_FEC for testing the implementation of FE_CAN_TURBO_FEC
for reporting unjustified log entries about changed channel pids for reporting unjustified log entries about changed channel pids
for reporting a problem with the frame detector in case it gets MaxPtsValues values
and stops analyzing even though the incoming data is still garbage
Marcel Unbehaun <frostworks@gmx.de> Marcel Unbehaun <frostworks@gmx.de>
for adding cRecordingInfo::GetEvent() for adding cRecordingInfo::GetEvent()

View File

@ -6634,3 +6634,6 @@ Video Disk Recorder Revision History
channel is being received with. channel is being received with.
- Fixed detecting frames in case the Picture Start Code or Access Unit Delimiter - Fixed detecting frames in case the Picture Start Code or Access Unit Delimiter
extends over TS packet boundaries (reported by Johan Andersson). extends over TS packet boundaries (reported by Johan Andersson).
- The frame detector now only starts collecting PTS values after it has seen the
first I-frame, otherwise it might get MaxPtsValues values and stop analyzing
even though the incoming data is still garbage (reported by Derek Kelly).

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: remux.c 2.54 2011/06/11 11:20:06 kls Exp $ * $Id: remux.c 2.55 2011/06/11 11:35:18 kls Exp $
*/ */
#include "remux.h" #include "remux.h"
@ -840,7 +840,7 @@ int cFrameDetector::Analyze(const uchar *Data, int Length)
// frame rate unknown, so collect a sequence of PTS values: // frame rate unknown, so collect a sequence of PTS values:
if (numPtsValues < MaxPtsValues && numIFrames < 2) { // collect a sequence containing at least two I-frames if (numPtsValues < MaxPtsValues && numIFrames < 2) { // collect a sequence containing at least two I-frames
const uchar *Pes = Data + TsPayloadOffset(Data); const uchar *Pes = Data + TsPayloadOffset(Data);
if (PesHasPts(Pes)) { if (numIFrames && PesHasPts(Pes)) {
ptsValues[numPtsValues] = PesGetPts(Pes); ptsValues[numPtsValues] = PesGetPts(Pes);
// check for rollover: // check for rollover:
if (numPtsValues && ptsValues[numPtsValues - 1] > 0xF0000000 && ptsValues[numPtsValues] < 0x10000000) { if (numPtsValues && ptsValues[numPtsValues - 1] > 0xF0000000 && ptsValues[numPtsValues] < 0x10000000) {