Empty adaptation field TS packets are now skipped when recording

This commit is contained in:
Klaus Schmidinger 2015-09-11 11:18:40 +02:00
parent 6f315bc235
commit e59b5bf1af
3 changed files with 30 additions and 1 deletions

View File

@ -2966,6 +2966,7 @@ Christopher Reimer <vdr@creimer.net>
for reporting a possible crash in the OSD demo
for adding support for systemd
for suggesting to replace VDR_CHARSET_OVERRIDE with a command line option
for making the recorder skip empty adaptation field TS packets
Stefan Huskamp <coca_cola1@gmx.de>
for suggesting to make entering characters via the number keys
@ -3423,3 +3424,7 @@ Daniel Ribeiro <drwyrm@gmail.com>
Janne Pänkälä <epankala@gmail.com>
for reporting that some broadcasters use the character 0x0D in EPG texts
Stefan Pöschel <basic.master@gmx.de>
for coding the AFFcleaner, parts of which were used to make the recorder skip empty
adaptation field TS packets

View File

@ -8823,3 +8823,5 @@ Video Disk Recorder Revision History
- The new setup option "Recording/Record key handling" can be used to define
what happens if the Record key on the remote control is pressed during
live tv (suggested by Dietmar Spingler).
- Empty adaptation field TS packets are now skipped when recording (thanks to
Christopher Reimer, based on the "AFFcleaner" by Stefan Pöschel).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: recorder.c 4.2 2015/09/05 11:43:51 kls Exp $
* $Id: recorder.c 4.3 2015/09/11 11:18:40 kls Exp $
*/
#include "recorder.h"
@ -109,6 +109,28 @@ void cRecorder::Activate(bool On)
void cRecorder::Receive(const uchar *Data, int Length)
{
if (Running()) {
static uchar aff[TS_SIZE - 4] = { 0xB7, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF}; // Length is always TS_SIZE!
if ((Data[3] & 0b00110000) == 0b00100000 && !memcmp(Data + 4, aff, sizeof(aff)))
return; // Adaptation Field Filler found, skipping
int p = ringBuffer->Put(Data, Length);
if (p != Length && Running())
ringBuffer->ReportOverflow(Length - p);