summaryrefslogtreecommitdiff
path: root/remux.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2006-03-26 19:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2006-03-26 19:00:00 +0200
commit49b561fcad16d3315fce8cb854de9f4ee6156640 (patch)
tree5612d6646e299dec266787f6068834f28c7ca81b /remux.c
parent9d12ac30f006ed63b4c9ab4c1a076b7d4f025022 (diff)
downloadvdr-patch-lnbsharing-49b561fcad16d3315fce8cb854de9f4ee6156640.tar.gz
vdr-patch-lnbsharing-49b561fcad16d3315fce8cb854de9f4ee6156640.tar.bz2
Version 1.3.45vdr-1.3.45
- Fixed updating the "Info" button in the "Timers" menu. - Reduced the number of events to actually check when setting events to timers. - cMenuEditIntItem now checks the given value and forces it to be between the given min and max limits. - The status changes of EPG events are now logged for all channels that have timers. - Removed the log message "deleting plugin: ..." when shutting down VDR (thanks to Christoph Haubrich for reporting that this is irritating when calling "vdr --help"). - Fixed cReadLine::Read() for lines that end with the infamous "\r\n" (thanks to Rolf Ahrenberg). - Fixed cDvbDevice::SetAudioBypass() in case setTransferModeForDolbyDigital is false (thanks to Werner Fink). - Updated 'sources.conf' (thanks to Oleg Roitburd). - Fixed the shutdown timeout (thanks to Alexander Wenzel). - Only calling RemoveEmptyVideoDirectories() once in case a recording has been deleted (reported by Hardy Flor). - Fixed deleting recordings that have been removed externally when running out of disk space (reported by Jan Lenz). - Fixed handling repeating VPS timers (they stopped recording too early). - Timer log messages now show "VPS" if this is a VPS timer. - Fixed getting the present EPG event in case none is currently 'running' (it then returns the one that just ended). - Fixed calling a plugin's main menu function while a message is being displayed (reported by Helmut Auer). - Updated the Russian OSD texts (thanks to Oleg Roitburd). - Made cMenuRecordings::GetRecording() 'protected' (suggested by Marius Heidenstecker). - Speeded up cRemux::ScanVideoPacket() (thanks to Reinhard Nissl). - Enhanced logging EPG event data. - Fixed format string handling (thanks to Darren Salt). - The new function cDevice::ForceTransferMode() can be used to force the primary device into transfer mode (thanks to Reinhard Nissl). - The 'version' of EPG events is now ignored when reading EPG data from 'epg.data' or via SVDRP/PUTE to avoid problems with double EPG events. - The 'running status' of EPG events is now only set to SI::RunningStatusNotRunning for events before the present event. - Fixed some #include sequences. - Single shot VPS timers are now only considered 'expired' if their associated EPG event has been explicitly set to SI::RunningStatusNotRunning. - The check for timers to be deleted is now done only every 30 seconds.
Diffstat (limited to 'remux.c')
-rw-r--r--remux.c44
1 files changed, 35 insertions, 9 deletions
diff --git a/remux.c b/remux.c
index 31ad719..ae4a17a 100644
--- a/remux.c
+++ b/remux.c
@@ -11,7 +11,7 @@
* The cRepacker family's code was originally written by Reinhard Nissl <rnissl@gmx.de>,
* and adapted to the VDR coding style by Klaus.Schmidinger@cadsoft.de.
*
- * $Id: remux.c 1.54 2006/02/03 16:19:02 kls Exp $
+ * $Id: remux.c 1.55 2006/03/25 12:27:30 kls Exp $
*/
#include "remux.h"
@@ -1429,7 +1429,9 @@ int cDolbyRepacker::BreakAt(const uchar *Data, int Count)
#define IPACKS 2048
// Start codes:
-#define SC_PICTURE 0x00 // "picture header"
+#define SC_SEQUENCE 0xB3 // "sequence header code"
+#define SC_GROUP 0xB8 // "group start code"
+#define SC_PICTURE 0x00 // "picture start code"
#define MAXNONUSEFULDATA (10*1024*1024)
#define MAXNUMUPTERRORS 10
@@ -1925,14 +1927,38 @@ int cRemux::ScanVideoPacket(const uchar *Data, int Count, int Offset, uchar &Pic
if (Length > 0) {
int PesPayloadOffset = 0;
if (AnalyzePesHeader(Data + Offset, Length, PesPayloadOffset) >= phMPEG1) {
- for (int i = Offset + PesPayloadOffset; i < Offset + Length - 5; i++) {
- if (Data[i] == 0 && Data[i + 1] == 0 && Data[i + 2] == 1) {
- switch (Data[i + 3]) {
- case SC_PICTURE: PictureType = (Data[i + 5] >> 3) & 0x07;
- return Length;
+ const uchar *p = Data + Offset + PesPayloadOffset + 2;
+ const uchar *pLimit = Data + Offset + Length - 3;
+#ifdef TEST_cVideoRepacker
+ // cVideoRepacker ensures that a new PES packet is started for a new sequence,
+ // group or picture which allows us to easily skip scanning through a huge
+ // amount of video data.
+ if (p < pLimit) {
+ if (p[-2] || p[-1] || p[0] != 0x01)
+ pLimit = 0; // skip scanning: packet doesn't start with 0x000001
+ else {
+ switch (p[1]) {
+ case SC_SEQUENCE:
+ case SC_GROUP:
+ case SC_PICTURE:
+ break;
+ default: // skip scanning: packet doesn't start a new sequence, group or picture
+ pLimit = 0;
+ }
+ }
+ }
+#endif
+ while (p < pLimit && (p = (const uchar *)memchr(p, 0x01, pLimit - p))) {
+ if (!p[-2] && !p[-1]) { // found 0x000001
+ switch (p[1]) {
+ case SC_PICTURE: PictureType = (p[3] >> 3) & 0x07;
+ return Length;
+ }
+ p += 4; // continue scanning after 0x01ssxxyy
}
- }
- }
+ else
+ p += 3; // continue scanning after 0x01xxyy
+ }
}
PictureType = NO_PICTURE;
return Length;