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

cPatPmtParser now also stores the audio stream types

This commit is contained in:
Klaus Schmidinger 2009-12-31 15:35:37 +01:00
parent a8260204c3
commit 3d7338de5a
3 changed files with 11 additions and 2 deletions

View File

@ -6233,3 +6233,4 @@ Video Disk Recorder Revision History
- cDevice::AddPid() now stores the stream type of the given pid (thanks to Andreas - cDevice::AddPid() now stores the stream type of the given pid (thanks to Andreas
Regel). Regel).
- Added cFont::FontName() and cFont::Size() (thanks to Andreas Regel). - Added cFont::FontName() and cFont::Size() (thanks to Andreas Regel).
- cPatPmtParser now also stores the audio stream types.

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.36 2009/12/29 15:46:12 kls Exp $ * $Id: remux.c 2.37 2009/12/31 15:35:37 kls Exp $
*/ */
#include "remux.h" #include "remux.h"
@ -489,6 +489,8 @@ void cPatPmtParser::ParsePmt(const uchar *Data, int Length)
apids[0] = 0; apids[0] = 0;
dpids[0] = 0; dpids[0] = 0;
spids[0] = 0; spids[0] = 0;
atypes[0] = 0;
dtypes[0] = 0;
SI::PMT::Stream stream; SI::PMT::Stream stream;
for (SI::Loop::Iterator it; Pmt.streamLoop.getNext(stream, it); ) { for (SI::Loop::Iterator it; Pmt.streamLoop.getNext(stream, it); ) {
dbgpatpmt(" stream type = %02X, pid = %d", stream.getStreamType(), stream.getPid()); dbgpatpmt(" stream type = %02X, pid = %d", stream.getStreamType(), stream.getPid());
@ -504,6 +506,7 @@ void cPatPmtParser::ParsePmt(const uchar *Data, int Length)
{ {
if (NumApids < MAXAPIDS) { if (NumApids < MAXAPIDS) {
apids[NumApids] = stream.getPid(); apids[NumApids] = stream.getPid();
atypes[NumApids] = stream.getStreamType();
*alangs[NumApids] = 0; *alangs[NumApids] = 0;
SI::Descriptor *d; SI::Descriptor *d;
for (SI::Loop::Iterator it; (d = stream.streamDescriptors.getNext(it)); ) { for (SI::Loop::Iterator it; (d = stream.streamDescriptors.getNext(it)); ) {
@ -593,6 +596,7 @@ void cPatPmtParser::ParsePmt(const uchar *Data, int Length)
if (dpid) { if (dpid) {
if (NumDpids < MAXDPIDS) { if (NumDpids < MAXDPIDS) {
dpids[NumDpids] = dpid; dpids[NumDpids] = dpid;
dtypes[NumDpids] = stream.getStreamType();
strn0cpy(dlangs[NumDpids], lang, sizeof(dlangs[NumDpids])); strn0cpy(dlangs[NumDpids], lang, sizeof(dlangs[NumDpids]));
if (updatePrimaryDevice) if (updatePrimaryDevice)
cDevice::PrimaryDevice()->SetAvailableTrack(ttDolby, NumDpids, dpid, lang); cDevice::PrimaryDevice()->SetAvailableTrack(ttDolby, NumDpids, dpid, lang);

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.22 2009/12/24 12:04:47 kls Exp $ * $Id: remux.h 2.23 2009/12/31 15:35:37 kls Exp $
*/ */
#ifndef __REMUX_H #ifndef __REMUX_H
@ -215,8 +215,10 @@ private:
int vpid; int vpid;
int vtype; int vtype;
int apids[MAXAPIDS + 1]; // list is zero-terminated int apids[MAXAPIDS + 1]; // list is zero-terminated
int atypes[MAXAPIDS + 1]; // list is zero-terminated
char alangs[MAXAPIDS][MAXLANGCODE2]; char alangs[MAXAPIDS][MAXLANGCODE2];
int dpids[MAXDPIDS + 1]; // list is zero-terminated int dpids[MAXDPIDS + 1]; // list is zero-terminated
int dtypes[MAXDPIDS + 1]; // list is zero-terminated
char dlangs[MAXDPIDS][MAXLANGCODE2]; char dlangs[MAXDPIDS][MAXLANGCODE2];
int spids[MAXSPIDS + 1]; // list is zero-terminated int spids[MAXSPIDS + 1]; // list is zero-terminated
char slangs[MAXSPIDS][MAXLANGCODE2]; char slangs[MAXSPIDS][MAXLANGCODE2];
@ -259,6 +261,8 @@ public:
int Apid(int i) const { return (0 <= i && i < MAXAPIDS) ? apids[i] : 0; } int Apid(int i) const { return (0 <= i && i < MAXAPIDS) ? apids[i] : 0; }
int Dpid(int i) const { return (0 <= i && i < MAXDPIDS) ? dpids[i] : 0; } int Dpid(int i) const { return (0 <= i && i < MAXDPIDS) ? dpids[i] : 0; }
int Spid(int i) const { return (0 <= i && i < MAXSPIDS) ? spids[i] : 0; } int Spid(int i) const { return (0 <= i && i < MAXSPIDS) ? spids[i] : 0; }
int Atype(int i) const { return (0 <= i && i < MAXAPIDS) ? atypes[i] : 0; }
int Dtype(int i) const { return (0 <= i && i < MAXDPIDS) ? dtypes[i] : 0; }
const char *Alang(int i) const { return (0 <= i && i < MAXAPIDS) ? alangs[i] : ""; } const char *Alang(int i) const { return (0 <= i && i < MAXAPIDS) ? alangs[i] : ""; }
const char *Dlang(int i) const { return (0 <= i && i < MAXDPIDS) ? dlangs[i] : ""; } const char *Dlang(int i) const { return (0 <= i && i < MAXDPIDS) ? dlangs[i] : ""; }
const char *Slang(int i) const { return (0 <= i && i < MAXSPIDS) ? slangs[i] : ""; } const char *Slang(int i) const { return (0 <= i && i < MAXSPIDS) ? slangs[i] : ""; }