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

In order to be able to play TS recordings from other sources, in which there is more than one PMT PID in the PAT, 'int cPatPmtParser::PatPmt(void)' has been changed to 'bool cPatPmtParser::IsPatPmt(int Pid)'

This commit is contained in:
Klaus Schmidinger 2012-11-19 10:32:31 +01:00
parent 56f8752b9a
commit 8f9136ecab
7 changed files with 34 additions and 23 deletions

View File

@ -7338,3 +7338,9 @@ Video Disk Recorder Revision History
marks at the same place as if it were one single mark. marks at the same place as if it were one single mark.
- Modified editing marks are now written to disk whenever the replay progress display - Modified editing marks are now written to disk whenever the replay progress display
gets hidden (thanks to Christoph Haubrich). gets hidden (thanks to Christoph Haubrich).
2012-11-19: Version 1.7.33
- In order to be able to play TS recordings from other sources, in which there is
more than one PMT PID in the PAT, 'int cPatPmtParser::PatPmt(void)' has been changed
to 'bool cPatPmtParser::IsPatPmt(int Pid)'.

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: config.h 2.54 2012/10/03 09:59:34 kls Exp $ * $Id: config.h 2.55 2012/11/19 10:24:24 kls Exp $
*/ */
#ifndef __CONFIG_H #ifndef __CONFIG_H
@ -22,13 +22,13 @@
// VDR's own version number: // VDR's own version number:
#define VDRVERSION "1.7.32" #define VDRVERSION "1.7.33"
#define VDRVERSNUM 10732 // Version * 10000 + Major * 100 + Minor #define VDRVERSNUM 10733 // Version * 10000 + Major * 100 + Minor
// The plugin API's version number: // The plugin API's version number:
#define APIVERSION "1.7.32" #define APIVERSION "1.7.33"
#define APIVERSNUM 10732 // Version * 10000 + Major * 100 + Minor #define APIVERSNUM 10733 // Version * 10000 + Major * 100 + Minor
// When loading plugins, VDR searches them by their APIVERSION, which // When loading plugins, VDR searches them by their APIVERSION, which
// may be smaller than VDRVERSION in case there have been no changes to // may be smaller than VDRVERSION in case there have been no changes to

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: cutter.c 2.16 2012/11/18 12:09:00 kls Exp $ * $Id: cutter.c 2.17 2012/11/19 10:21:44 kls Exp $
*/ */
#include "cutter.h" #include "cutter.h"
@ -132,7 +132,7 @@ bool cDanglingPacketStripper::Process(uchar *Data, int Length, int64_t FirstPts)
int Pid = TsPid(Data); int Pid = TsPid(Data);
if (Pid == PATPID) if (Pid == PATPID)
patPmtParser.ParsePat(Data, TS_SIZE); patPmtParser.ParsePat(Data, TS_SIZE);
else if (Pid == patPmtParser.PmtPid()) else if (patPmtParser.IsPmtPid(Pid))
patPmtParser.ParsePmt(Data, TS_SIZE); patPmtParser.ParsePmt(Data, TS_SIZE);
else { else {
int64_t Pts = TsGetPts(Data, TS_SIZE); int64_t Pts = TsGetPts(Data, TS_SIZE);
@ -408,7 +408,7 @@ void cCuttingThread::GetPendingPackets(uchar *Data, int &Length, int Index, int6
int Pid = TsPid(p); int Pid = TsPid(p);
if (Pid == PATPID) if (Pid == PATPID)
PatPmtParser.ParsePat(p, TS_SIZE); PatPmtParser.ParsePat(p, TS_SIZE);
else if (Pid == PatPmtParser.PmtPid()) else if (PatPmtParser.IsPmtPid(Pid))
PatPmtParser.ParsePmt(p, TS_SIZE); PatPmtParser.ParsePmt(p, TS_SIZE);
else if (!Processed[Pid]) { else if (!Processed[Pid]) {
int64_t Pts = TsGetPts(p, TS_SIZE); int64_t Pts = TsGetPts(p, TS_SIZE);

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: device.c 2.69 2012/11/13 09:11:43 kls Exp $ * $Id: device.c 2.70 2012/11/19 09:59:09 kls Exp $
*/ */
#include "device.h" #include "device.h"
@ -1149,7 +1149,7 @@ void cDevice::StillPicture(const uchar *Data, int Length)
int Pid = TsPid(Data); int Pid = TsPid(Data);
if (Pid == PATPID) if (Pid == PATPID)
patPmtParser.ParsePat(Data, TS_SIZE); patPmtParser.ParsePat(Data, TS_SIZE);
else if (Pid == patPmtParser.PmtPid()) else if (patPmtParser.IsPmtPid(Pid))
patPmtParser.ParsePmt(Data, TS_SIZE); patPmtParser.ParsePmt(Data, TS_SIZE);
else if (Pid == patPmtParser.Vpid()) { else if (Pid == patPmtParser.Vpid()) {
if (TsPayloadStart(Data)) { if (TsPayloadStart(Data)) {
@ -1486,7 +1486,7 @@ int cDevice::PlayTs(const uchar *Data, int Length, bool VideoOnly)
if (PayloadOffset < TS_SIZE) { if (PayloadOffset < TS_SIZE) {
if (Pid == PATPID) if (Pid == PATPID)
patPmtParser.ParsePat(Data, TS_SIZE); patPmtParser.ParsePat(Data, TS_SIZE);
else if (Pid == patPmtParser.PmtPid()) else if (patPmtParser.IsPmtPid(Pid))
patPmtParser.ParsePmt(Data, TS_SIZE); patPmtParser.ParsePmt(Data, TS_SIZE);
else if (Pid == patPmtParser.Vpid()) { else if (Pid == patPmtParser.Vpid()) {
isPlayingVideo = true; isPlayingVideo = true;

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: recording.c 2.73 2012/11/13 13:46:49 kls Exp $ * $Id: recording.c 2.74 2012/11/19 10:01:01 kls Exp $
*/ */
#include "recording.h" #include "recording.h"
@ -1606,7 +1606,7 @@ void cIndexFileGenerator::Action(void)
int Pid = TsPid(p); int Pid = TsPid(p);
if (Pid == PATPID) if (Pid == PATPID)
PatPmtParser.ParsePat(p, TS_SIZE); PatPmtParser.ParsePat(p, TS_SIZE);
else if (Pid == PatPmtParser.PmtPid()) else if (PatPmtParser.IsPmtPid(Pid))
PatPmtParser.ParsePmt(p, TS_SIZE); PatPmtParser.ParsePmt(p, TS_SIZE);
Length -= TS_SIZE; Length -= TS_SIZE;
p += TS_SIZE; p += TS_SIZE;
@ -2132,7 +2132,7 @@ bool cFileName::GetLastPatPmtVersions(int &PatVersion, int &PmtVersion)
int Pid = TsPid(buf); int Pid = TsPid(buf);
if (Pid == PATPID) if (Pid == PATPID)
PatPmtParser.ParsePat(buf, sizeof(buf)); PatPmtParser.ParsePat(buf, sizeof(buf));
else if (Pid == PatPmtParser.PmtPid()) { else if (PatPmtParser.IsPmtPid(Pid)) {
PatPmtParser.ParsePmt(buf, sizeof(buf)); PatPmtParser.ParsePmt(buf, sizeof(buf));
if (PatPmtParser.GetVersions(PatVersion, PmtVersion)) { if (PatPmtParser.GetVersions(PatVersion, PmtVersion)) {
close(fd); close(fd);

11
remux.c
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.71 2012/11/18 12:18:08 kls Exp $ * $Id: remux.c 2.72 2012/11/19 10:23:42 kls Exp $
*/ */
#include "remux.h" #include "remux.h"
@ -574,7 +574,7 @@ void cPatPmtParser::Reset(void)
{ {
pmtSize = 0; pmtSize = 0;
patVersion = pmtVersion = -1; patVersion = pmtVersion = -1;
pmtPid = -1; pmtPids[0] = 0;
vpid = vtype = 0; vpid = vtype = 0;
ppid = 0; ppid = 0;
} }
@ -594,14 +594,17 @@ void cPatPmtParser::ParsePat(const uchar *Data, int Length)
dbgpatpmt("PAT: TSid = %d, c/n = %d, v = %d, s = %d, ls = %d\n", Pat.getTransportStreamId(), Pat.getCurrentNextIndicator(), Pat.getVersionNumber(), Pat.getSectionNumber(), Pat.getLastSectionNumber()); dbgpatpmt("PAT: TSid = %d, c/n = %d, v = %d, s = %d, ls = %d\n", Pat.getTransportStreamId(), Pat.getCurrentNextIndicator(), Pat.getVersionNumber(), Pat.getSectionNumber(), Pat.getLastSectionNumber());
if (patVersion == Pat.getVersionNumber()) if (patVersion == Pat.getVersionNumber())
return; return;
int NumPmtPids = 0;
SI::PAT::Association assoc; SI::PAT::Association assoc;
for (SI::Loop::Iterator it; Pat.associationLoop.getNext(assoc, it); ) { for (SI::Loop::Iterator it; Pat.associationLoop.getNext(assoc, it); ) {
dbgpatpmt(" isNITPid = %d\n", assoc.isNITPid()); dbgpatpmt(" isNITPid = %d\n", assoc.isNITPid());
if (!assoc.isNITPid()) { if (!assoc.isNITPid()) {
pmtPid = assoc.getPid(); if (NumPmtPids <= MAX_PMT_PIDS)
pmtPids[NumPmtPids++] = assoc.getPid();
dbgpatpmt(" service id = %d, pid = %d\n", assoc.getServiceId(), assoc.getPid()); dbgpatpmt(" service id = %d, pid = %d\n", assoc.getServiceId(), assoc.getPid());
} }
} }
pmtPids[NumPmtPids] = 0;
patVersion = Pat.getVersionNumber(); patVersion = Pat.getVersionNumber();
} }
else else
@ -839,7 +842,7 @@ bool cPatPmtParser::ParsePatPmt(const uchar *Data, int Length)
int Pid = TsPid(Data); int Pid = TsPid(Data);
if (Pid == PATPID) if (Pid == PATPID)
ParsePat(Data, TS_SIZE); ParsePat(Data, TS_SIZE);
else if (Pid == PmtPid()) { else if (IsPmtPid(Pid)) {
ParsePmt(Data, TS_SIZE); ParsePmt(Data, TS_SIZE);
if (patVersion >= 0 && pmtVersion >= 0) if (patVersion >= 0 && pmtVersion >= 0)
return true; return true;

12
remux.h
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.h 2.35 2012/11/18 12:17:23 kls Exp $ * $Id: remux.h 2.36 2012/11/19 10:22:28 kls Exp $
*/ */
#ifndef __REMUX_H #ifndef __REMUX_H
@ -327,13 +327,15 @@ public:
// PAT/PMT Parser: // PAT/PMT Parser:
#define MAX_PMT_PIDS 32
class cPatPmtParser { class cPatPmtParser {
private: private:
uchar pmt[MAX_SECTION_SIZE]; uchar pmt[MAX_SECTION_SIZE];
int pmtSize; int pmtSize;
int patVersion; int patVersion;
int pmtVersion; int pmtVersion;
int pmtPid; int pmtPids[MAX_PMT_PIDS + 1]; // list is zero-terminated
int vpid; int vpid;
int ppid; int ppid;
int vtype; int vtype;
@ -373,9 +375,9 @@ public:
bool GetVersions(int &PatVersion, int &PmtVersion) const; bool GetVersions(int &PatVersion, int &PmtVersion) const;
///< Returns true if a valid PAT/PMT has been parsed and stores ///< Returns true if a valid PAT/PMT has been parsed and stores
///< the current version numbers in the given variables. ///< the current version numbers in the given variables.
int PmtPid(void) const { return pmtPid; } bool IsPmtPid(int Pid) const { for (int i = 0; pmtPids[i]; i++) if (pmtPids[i] == Pid) return true; return false; }
///< Returns the PMT pid as defined by the current PAT. ///< Returns true if Pid the one of the PMT pids as defined by the current PAT.
///< If no PAT has been received yet, -1 will be returned. ///< If no PAT has been received yet, false will be returned.
int Vpid(void) const { return vpid; } int Vpid(void) const { return vpid; }
///< Returns the video pid as defined by the current PMT, or 0 if no video ///< Returns the video pid as defined by the current PMT, or 0 if no video
///< pid has been detected, yet. ///< pid has been detected, yet.