mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Fixed extracting the ES data and added MPEG1 handling to cDvbDevice::StillPicture()
This commit is contained in:
parent
bbffcee572
commit
d800cf56f5
@ -176,6 +176,7 @@ Stefan Huelswitt <huels@iname.com>
|
|||||||
for fixing a memory leak in cNonBlockingFileReader
|
for fixing a memory leak in cNonBlockingFileReader
|
||||||
for fixing an uninitialized variable in cDisplayChannel
|
for fixing an uninitialized variable in cDisplayChannel
|
||||||
for fixing a possible access of invalid file handles in cSIProcessor::Action()
|
for fixing a possible access of invalid file handles in cSIProcessor::Action()
|
||||||
|
for fixing extracting the ES data in cDvbDevice::StillPicture()
|
||||||
|
|
||||||
Ulrich Röder <roeder@efr-net.de>
|
Ulrich Röder <roeder@efr-net.de>
|
||||||
for pointing out that there are channels that have a symbol rate higher than
|
for pointing out that there are channels that have a symbol rate higher than
|
||||||
@ -267,6 +268,7 @@ Andy Grobb <Charly98@01019freenet.de>
|
|||||||
|
|
||||||
Thomas Heiligenmann <thomas@heiligenmann.de>
|
Thomas Heiligenmann <thomas@heiligenmann.de>
|
||||||
for implementing the SVDRP commands LSTR and DELR
|
for implementing the SVDRP commands LSTR and DELR
|
||||||
|
for adding MPEG1 handling to cDvbDevice::StillPicture()
|
||||||
|
|
||||||
Norbert Schmidt <nschmidt-nrw@t-online.de>
|
Norbert Schmidt <nschmidt-nrw@t-online.de>
|
||||||
for filling in some missing teletext PIDs
|
for filling in some missing teletext PIDs
|
||||||
|
6
HISTORY
6
HISTORY
@ -2403,7 +2403,7 @@ Video Disk Recorder Revision History
|
|||||||
|
|
||||||
- Updated 'channels.conf.cable' (thanks to Stefan Hußfeldt).
|
- Updated 'channels.conf.cable' (thanks to Stefan Hußfeldt).
|
||||||
|
|
||||||
2003-10-03: Version 1.3.0
|
2003-10-17: Version 1.2.6pre1
|
||||||
|
|
||||||
- Updated the required driver version in INSTALL (thanks to Jens Groth for
|
- Updated the required driver version in INSTALL (thanks to Jens Groth for
|
||||||
reporting this one).
|
reporting this one).
|
||||||
@ -2420,3 +2420,7 @@ Video Disk Recorder Revision History
|
|||||||
- Now trying to get a timer's channel without RID when loading 'timers.conf'
|
- Now trying to get a timer's channel without RID when loading 'timers.conf'
|
||||||
(thanks to Thomas Rausch).
|
(thanks to Thomas Rausch).
|
||||||
- Removed the unused 0x73 (TOT) filter in eit.c (thanks to Andreas Trauer).
|
- Removed the unused 0x73 (TOT) filter in eit.c (thanks to Andreas Trauer).
|
||||||
|
- Fixed extracting the ES data in cDvbDevice::StillPicture() (thanks to Stefan
|
||||||
|
Huelswitt).
|
||||||
|
- Added MPEG1 handling to cDvbDevice::StillPicture() (thanks to Thomas
|
||||||
|
Heiligenmann).
|
||||||
|
6
config.h
6
config.h
@ -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: config.h 1.175 2003/10/03 11:49:31 kls Exp $
|
* $Id: config.h 1.176 2003/10/17 12:35:23 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __CONFIG_H
|
#ifndef __CONFIG_H
|
||||||
@ -19,8 +19,8 @@
|
|||||||
#include "device.h"
|
#include "device.h"
|
||||||
#include "tools.h"
|
#include "tools.h"
|
||||||
|
|
||||||
#define VDRVERSION "1.3.0"
|
#define VDRVERSION "1.2.6pre1"
|
||||||
#define VDRVERSNUM 10300 // Version * 10000 + Major * 100 + Minor
|
#define VDRVERSNUM 10206 // Version * 10000 + Major * 100 + Minor
|
||||||
|
|
||||||
#define MAXPRIORITY 99
|
#define MAXPRIORITY 99
|
||||||
#define MAXLIFETIME 99
|
#define MAXLIFETIME 99
|
||||||
|
60
dvbdevice.c
60
dvbdevice.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: dvbdevice.c 1.65 2003/10/04 12:31:15 kls Exp $
|
* $Id: dvbdevice.c 1.66 2003/10/17 13:31:06 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dvbdevice.h"
|
#include "dvbdevice.h"
|
||||||
@ -947,21 +947,53 @@ void cDvbDevice::StillPicture(const uchar *Data, int Length)
|
|||||||
return;
|
return;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int blen = 0;
|
int blen = 0;
|
||||||
while (i < Length - 4) {
|
while (i < Length - 6) {
|
||||||
if (Data[i] == 0x00 && Data[i + 1] == 0x00 && Data[i + 2] == 0x01 && (Data[i + 3] & 0xF0) == 0xE0) {
|
if (Data[i] == 0x00 && Data[i + 1] == 0x00 && Data[i + 2] == 0x01) {
|
||||||
// skip PES header
|
|
||||||
int offs = i + 6;
|
|
||||||
int len = Data[i + 4] * 256 + Data[i + 5];
|
int len = Data[i + 4] * 256 + Data[i + 5];
|
||||||
// skip header extension
|
if ((Data[i + 3] & 0xF0) == 0xE0) { // video packet
|
||||||
if ((Data[i + 6] & 0xC0) == 0x80) {
|
// skip PES header
|
||||||
offs += 3;
|
int offs = i + 6;
|
||||||
offs += Data[i + 8];
|
// skip header extension
|
||||||
len -= 3;
|
if ((Data[i + 6] & 0xC0) == 0x80) {
|
||||||
len -= Data[i + 8];
|
// MPEG-2 PES header
|
||||||
|
offs += 3;
|
||||||
|
offs += Data[i + 8];
|
||||||
|
len -= 3;
|
||||||
|
len -= Data[i + 8];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// MPEG-1 PES header
|
||||||
|
while (offs < Length && len > 0 && Data[offs] == 0xFF) {
|
||||||
|
offs++;
|
||||||
|
len--;
|
||||||
|
}
|
||||||
|
if ((Data[offs] & 0xC0) == 0x40) {
|
||||||
|
offs += 2;
|
||||||
|
len -= 2;
|
||||||
|
}
|
||||||
|
if ((Data[offs] & 0xF0) == 0x20) {
|
||||||
|
offs += 5;
|
||||||
|
len -= 5;
|
||||||
|
}
|
||||||
|
else if ((Data[offs] & 0xF0) == 0x30) {
|
||||||
|
offs += 10;
|
||||||
|
len -= 10;
|
||||||
|
}
|
||||||
|
else if (Data[offs] == 0x0F) {
|
||||||
|
offs++;
|
||||||
|
len--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (blen + len > Length) // invalid PES length field
|
||||||
|
break;
|
||||||
|
memcpy(&buf[blen], &Data[offs], len);
|
||||||
|
i = offs + len;
|
||||||
|
blen += len;
|
||||||
}
|
}
|
||||||
memcpy(&buf[blen], &Data[offs], len);
|
else if (Data[i + 3] >= 0xBD && Data[i + 3] <= 0xDF) // other PES packets
|
||||||
i = offs + len;
|
i += len + 6;
|
||||||
blen += len;
|
else
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
i++;
|
i++;
|
||||||
|
Loading…
Reference in New Issue
Block a user