git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixes bug #291
[enigma2.git]
/
lib
/
dvb
/
pmt.cpp
diff --git
a/lib/dvb/pmt.cpp
b/lib/dvb/pmt.cpp
index e1aa096d309f391ce6c9ca938bf433c59a9a3a0f..9bd065b3d075e4ebf90bc8a77909e5902f909a21 100644
(file)
--- a/
lib/dvb/pmt.cpp
+++ b/
lib/dvb/pmt.cpp
@@
-184,6
+184,7
@@
int eDVBServicePMTHandler::getProgramInfo(struct program &program)
int first_ac3 = -1;
program.defaultAudioStream = 0;
int first_ac3 = -1;
program.defaultAudioStream = 0;
+ audioStream *prev_audio = 0;
if ( m_service && !m_service->cacheEmpty() )
{
if ( m_service && !m_service->cacheEmpty() )
{
@@
-214,14
+215,16
@@
int eDVBServicePMTHandler::getProgramInfo(struct program &program)
ElementaryStreamInfoConstIterator es;
for (es = pmt.getEsInfo()->begin(); es != pmt.getEsInfo()->end(); ++es)
{
ElementaryStreamInfoConstIterator es;
for (es = pmt.getEsInfo()->begin(); es != pmt.getEsInfo()->end(); ++es)
{
- int isaudio = 0, isvideo = 0, issubtitle = 0, forced_video = 0, forced_audio = 0;
+ int isaudio = 0, isvideo = 0, issubtitle = 0, forced_video = 0, forced_audio = 0, isteletext = 0;
+ int streamtype = (*es)->getType();
videoStream video;
audioStream audio;
audio.component_tag=video.component_tag=-1;
video.type = videoStream::vtMPEG2;
audio.type = audioStream::atMPEG;
videoStream video;
audioStream audio;
audio.component_tag=video.component_tag=-1;
video.type = videoStream::vtMPEG2;
audio.type = audioStream::atMPEG;
+ audio.rdsPid = -1;
- switch (
(*es)->getType()
)
+ switch (
streamtype
)
{
case 0x1b: // AVC Video Stream (MPEG4 H264)
video.type = videoStream::vtMPEG4_H264;
{
case 0x1b: // AVC Video Stream (MPEG4 H264)
video.type = videoStream::vtMPEG4_H264;
@@
-285,11
+288,14
@@
int eDVBServicePMTHandler::getProgramInfo(struct program &program)
}
case 0x06: // PES Private
case 0xEA: // TS_PSI_ST_SMPTE_VC1
}
case 0x06: // PES Private
case 0xEA: // TS_PSI_ST_SMPTE_VC1
+ {
+ int num_descriptors = 0;
for (DescriptorConstIterator desc = (*es)->getDescriptors()->begin();
desc != (*es)->getDescriptors()->end(); ++desc)
{
uint8_t tag = (*desc)->getTag();
/* check descriptors to get the exakt stream type. */
for (DescriptorConstIterator desc = (*es)->getDescriptors()->begin();
desc != (*es)->getDescriptors()->end(); ++desc)
{
uint8_t tag = (*desc)->getTag();
/* check descriptors to get the exakt stream type. */
+ ++num_descriptors;
if (!forced_video && !forced_audio)
{
switch (tag)
if (!forced_video && !forced_audio)
{
switch (tag)
@@
-342,6
+348,7
@@
int eDVBServicePMTHandler::getProgramInfo(struct program &program)
s.subtitling_type = 0x01; // EBU TELETEXT SUBTITLES
s.pid = program.textPid = (*es)->getPid();
TeletextDescriptor *d = (TeletextDescriptor*)(*desc);
s.subtitling_type = 0x01; // EBU TELETEXT SUBTITLES
s.pid = program.textPid = (*es)->getPid();
TeletextDescriptor *d = (TeletextDescriptor*)(*desc);
+ isteletext = 1;
const VbiTeletextList *list = d->getVbiTeletexts();
for (VbiTeletextConstIterator it(list->begin()); it != list->end(); ++it)
{
const VbiTeletextList *list = d->getVbiTeletexts();
for (VbiTeletextConstIterator it(list->begin()); it != list->end(); ++it)
{
@@
-399,9
+406,9
@@
int eDVBServicePMTHandler::getProgramInfo(struct program &program)
case 0x56432d31: // == 'VC-1'
{
const AdditionalIdentificationInfoVector *vec = d->getAdditionalIdentificationInfo();
case 0x56432d31: // == 'VC-1'
{
const AdditionalIdentificationInfoVector *vec = d->getAdditionalIdentificationInfo();
- if (vec->size() > 1 && (*vec)[
1
] == 0x01) // subdescriptor tag
+ if (vec->size() > 1 && (*vec)[
0
] == 0x01) // subdescriptor tag
{
{
- if ((*vec)[
2
] >= 0x90) // profile_level
+ if ((*vec)[
1
] >= 0x90) // profile_level
video.type = videoStream::vtVC1; // advanced profile
else
video.type = videoStream::vtVC1_SM; // simple main
video.type = videoStream::vtVC1; // advanced profile
else
video.type = videoStream::vtVC1_SM; // simple main
@@
-457,14
+464,26
@@
int eDVBServicePMTHandler::getProgramInfo(struct program &program)
break;
}
}
break;
}
}
+ if (!num_descriptors && streamtype == 0x06 && prev_audio)
+ {
+ prev_audio->rdsPid = (*es)->getPid();
+ eDebug("Rds PID %04x detected ? ! ?", prev_audio->rdsPid);
+ }
+ prev_audio = 0;
+ }
default:
break;
}
default:
break;
}
- if (issubtitle && (isaudio || isvideo))
+ if (isteletext && (isaudio || isvideo))
+ {
+ eDebug("ambiguous streamtype for PID %04x detected.. forced as teletext!", (*es)->getPid());
+ continue; // continue with next PID
+ }
+ else if (issubtitle && (isaudio || isvideo))
eDebug("ambiguous streamtype for PID %04x detected.. forced as subtitle!", (*es)->getPid());
else if (isaudio && isvideo)
eDebug("ambiguous streamtype for PID %04x detected.. forced as video!", (*es)->getPid());
eDebug("ambiguous streamtype for PID %04x detected.. forced as subtitle!", (*es)->getPid());
else if (isaudio && isvideo)
eDebug("ambiguous streamtype for PID %04x detected.. forced as video!", (*es)->getPid());
- if (issubtitle)
+ if (issubtitle)
// continue with next PID
continue;
else if (isvideo)
{
continue;
else if (isvideo)
{
@@
-490,6
+509,7
@@
int eDVBServicePMTHandler::getProgramInfo(struct program &program)
first_ac3 = program.audioStreams.size();
program.audioStreams.push_back(audio);
first_ac3 = program.audioStreams.size();
program.audioStreams.push_back(audio);
+ prev_audio = &program.audioStreams.back();
}
else
continue;
}
else
continue;
@@
-542,6
+562,7
@@
int eDVBServicePMTHandler::getProgramInfo(struct program &program)
audioStream s;
s.type = audioStream::atAC3;
s.pid = cached_apid_ac3;
audioStream s;
s.type = audioStream::atAC3;
s.pid = cached_apid_ac3;
+ s.rdsPid = -1;
program.audioStreams.push_back(s);
++cnt;
}
program.audioStreams.push_back(s);
++cnt;
}
@@
-550,6
+571,7
@@
int eDVBServicePMTHandler::getProgramInfo(struct program &program)
audioStream s;
s.type = audioStream::atMPEG;
s.pid = cached_apid_mpeg;
audioStream s;
s.type = audioStream::atMPEG;
s.pid = cached_apid_mpeg;
+ s.rdsPid = -1;
program.audioStreams.push_back(s);
++cnt;
}
program.audioStreams.push_back(s);
++cnt;
}
@@
-675,10
+697,7
@@
int eDVBServicePMTHandler::tune(eServiceReferenceDVB &ref, int use_decode_demux,
eDVBCIInterfaces::getInstance()->addPMTHandler(this);
} else if (!simulate) // no simulation of playback services
{
eDVBCIInterfaces::getInstance()->addPMTHandler(this);
} else if (!simulate) // no simulation of playback services
{
- eDVBMetaParser parser;
-
- int ret=parser.parseFile(ref.path);
- if (ret || !parser.m_ref.getServiceID().get() /* incorrect sid in meta file or recordings.epl*/ )
+ if (!ref.getServiceID().get() /* incorrect sid in meta file or recordings.epl*/ )
{
eWarning("no .meta file found, trying to find PMT pid");
eDVBTSTools tstools;
{
eWarning("no .meta file found, trying to find PMT pid");
eDVBTSTools tstools;
@@
-694,9
+713,7
@@
int eDVBServicePMTHandler::tune(eServiceReferenceDVB &ref, int use_decode_demux,
m_pmt_pid = pmt_pid;
}
}
m_pmt_pid = pmt_pid;
}
}
- } else
- m_reference = parser.m_ref;
-
+ }
eDebug("alloc PVR");
/* allocate PVR */
res = m_resourceManager->allocatePVRChannel(m_pvr_channel);
eDebug("alloc PVR");
/* allocate PVR */
res = m_resourceManager->allocatePVRChannel(m_pvr_channel);