mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Fixed cDolbyRepacker to allow recording ProSieben HD broadcasts
This commit is contained in:
parent
57e34f6240
commit
76ca67473c
2
HISTORY
2
HISTORY
@ -3455,3 +3455,5 @@ Video Disk Recorder Revision History
|
|||||||
- Fixed a few French OSD texts that were in the wrong place.
|
- Fixed a few French OSD texts that were in the wrong place.
|
||||||
- Improved matching timers to EPG events, especially in case there are several events
|
- Improved matching timers to EPG events, especially in case there are several events
|
||||||
with the same VPS time.
|
with the same VPS time.
|
||||||
|
- Fixed cDolbyRepacker to allow recording ProSieben HD broadcasts (thanks to Reinhard
|
||||||
|
Nissl).
|
||||||
|
25
remux.c
25
remux.c
@ -11,7 +11,7 @@
|
|||||||
* The cDolbyRepacker code was originally written by Reinhard Nissl <rnissl@gmx.de>,
|
* The cDolbyRepacker code was originally written by Reinhard Nissl <rnissl@gmx.de>,
|
||||||
* and adapted to the VDR coding style by Klaus.Schmidinger@cadsoft.de.
|
* and adapted to the VDR coding style by Klaus.Schmidinger@cadsoft.de.
|
||||||
*
|
*
|
||||||
* $Id: remux.c 1.31 2005/02/13 14:36:23 kls Exp $
|
* $Id: remux.c 1.32 2005/03/13 12:02:15 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "remux.h"
|
#include "remux.h"
|
||||||
@ -46,6 +46,8 @@ private:
|
|||||||
int fragmentTodo;
|
int fragmentTodo;
|
||||||
uchar pesHeader[6 + 3 + 255 + 4 + 4];
|
uchar pesHeader[6 + 3 + 255 + 4 + 4];
|
||||||
int pesHeaderLen;
|
int pesHeaderLen;
|
||||||
|
uchar pesHeaderBackup[6 + 3 + 255];
|
||||||
|
int pesHeaderBackupLen;
|
||||||
uchar chk1;
|
uchar chk1;
|
||||||
uchar chk2;
|
uchar chk2;
|
||||||
int ac3todo;
|
int ac3todo;
|
||||||
@ -131,6 +133,7 @@ void cDolbyRepacker::Reset(void)
|
|||||||
chk2 = 0;
|
chk2 = 0;
|
||||||
fragmentLen = 0;
|
fragmentLen = 0;
|
||||||
fragmentTodo = 0;
|
fragmentTodo = 0;
|
||||||
|
pesHeaderBackupLen = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cDolbyRepacker::FinishRemainder(cRingBufferLinear *ResultBuffer, const uchar *const Data, const int Todo, int &Done, int &Bite)
|
bool cDolbyRepacker::FinishRemainder(cRingBufferLinear *ResultBuffer, const uchar *const Data, const int Todo, int &Done, int &Bite)
|
||||||
@ -229,12 +232,17 @@ int cDolbyRepacker::Put(cRingBufferLinear *ResultBuffer, const uchar *Data, int
|
|||||||
if ((Data[6] & 0xC0) != 0x80)
|
if ((Data[6] & 0xC0) != 0x80)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
// backup PES header
|
||||||
|
if (Data[6] != 0x80 || Data[7] != 0x00 || Data[8] != 0x00) {
|
||||||
|
pesHeaderBackupLen = 6 + 3 + Data[8];
|
||||||
|
memcpy(pesHeaderBackup, Data, pesHeaderBackupLen);
|
||||||
|
}
|
||||||
|
|
||||||
// skip PES header
|
// skip PES header
|
||||||
int done = 6 + 3 + Data[8];
|
int done = 6 + 3 + Data[8];
|
||||||
int todo = Count - done;
|
int todo = Count - done;
|
||||||
const uchar *data = Data + done;
|
const uchar *data = Data + done;
|
||||||
bool headerCopied = false;
|
|
||||||
|
|
||||||
// look for 0x0B 0x77 <chk1> <chk2> <frameSize>
|
// look for 0x0B 0x77 <chk1> <chk2> <frameSize>
|
||||||
while (todo > 0) {
|
while (todo > 0) {
|
||||||
switch (state) {
|
switch (state) {
|
||||||
@ -242,10 +250,10 @@ int cDolbyRepacker::Put(cRingBufferLinear *ResultBuffer, const uchar *Data, int
|
|||||||
if (*data == 0x0B) {
|
if (*data == 0x0B) {
|
||||||
++(int &)state;
|
++(int &)state;
|
||||||
// copy header information once for later use
|
// copy header information once for later use
|
||||||
if (!headerCopied) {
|
if (pesHeaderBackupLen > 0) {
|
||||||
headerCopied = true;
|
pesHeaderLen = pesHeaderBackupLen;
|
||||||
pesHeaderLen = 6 + 3 + Data[8];
|
pesHeaderBackupLen = 0;
|
||||||
memcpy(pesHeader, Data, pesHeaderLen);
|
memcpy(pesHeader, pesHeaderBackup, pesHeaderLen);
|
||||||
AppendSubStreamID();
|
AppendSubStreamID();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -279,9 +287,8 @@ int cDolbyRepacker::Put(cRingBufferLinear *ResultBuffer, const uchar *Data, int
|
|||||||
ac3todo = 2 * frameSizes[*data];
|
ac3todo = 2 * frameSizes[*data];
|
||||||
// frameSizeCode was invalid => restart searching
|
// frameSizeCode was invalid => restart searching
|
||||||
if (ac3todo <= 0) {
|
if (ac3todo <= 0) {
|
||||||
// reset PES header instead of using/copying a wrong one
|
// reset PES header instead of using a wrong one
|
||||||
ResetPesHeader();
|
ResetPesHeader();
|
||||||
headerCopied = true;
|
|
||||||
if (chk1 == 0x0B) {
|
if (chk1 == 0x0B) {
|
||||||
if (chk2 == 0x77) {
|
if (chk2 == 0x77) {
|
||||||
state = store_chk1;
|
state = store_chk1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user