git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
do not translate empty string
[enigma2.git]
/
lib
/
service
/
servicedvb.cpp
diff --git
a/lib/service/servicedvb.cpp
b/lib/service/servicedvb.cpp
index 3008a9d2d22627dc1080b7531ad476770ee03689..9da276e580b4ee7a2a494d9c50f84ca3cbc15734 100644
(file)
--- a/
lib/service/servicedvb.cpp
+++ b/
lib/service/servicedvb.cpp
@@
-21,6
+21,7
@@
#include <lib/gui/esubtitle.h>
#include <sys/vfs.h>
#include <lib/gui/esubtitle.h>
#include <sys/vfs.h>
+#include <sys/stat.h>
#include <byteswap.h>
#include <netinet/in.h>
#include <byteswap.h>
#include <netinet/in.h>
@@
-312,6
+313,9
@@
eServiceFactoryDVB::eServiceFactoryDVB()
eServiceCenter::getPrivInstance(sc);
if (sc)
sc->addServiceFactory(eServiceFactoryDVB::id, this);
eServiceCenter::getPrivInstance(sc);
if (sc)
sc->addServiceFactory(eServiceFactoryDVB::id, this);
+
+ m_StaticServiceDVBInfo = new eStaticServiceDVBInformation;
+ m_StaticServiceDVBBouquetInfo = new eStaticServiceDVBBouquetInformation;
}
eServiceFactoryDVB::~eServiceFactoryDVB()
}
eServiceFactoryDVB::~eServiceFactoryDVB()
@@
-392,6
+396,7
@@
RESULT eDVBServiceList::getContent(std::list<eServiceReference> &list, bool sort
// useable format options are
// R = Service Reference (as swig object .. this is very slow)
// S = Service Reference (as python string object .. same as ref.toString())
// useable format options are
// R = Service Reference (as swig object .. this is very slow)
// S = Service Reference (as python string object .. same as ref.toString())
+// C = Service Reference (as python string object .. same as ref.toCompareString())
// N = Service Name (as python string object)
// when exactly one return value per service is selected in the format string,
// then each value is directly a list entry
// N = Service Name (as python string object)
// when exactly one return value per service is selected in the format string,
// then each value is directly a list entry
@@
-431,6
+436,9
@@
PyObject *eDVBServiceList::getContent(const char* format, bool sorted)
case 'R': // service reference (swig)object
tmp = New_eServiceReference(ref);
break;
case 'R': // service reference (swig)object
tmp = New_eServiceReference(ref);
break;
+ case 'C': // service reference compare string
+ tmp = PyString_FromString(ref.toCompareString().c_str());
+ break;
case 'S': // service reference string
tmp = PyString_FromString(ref.toString().c_str());
break;
case 'S': // service reference string
tmp = PyString_FromString(ref.toString().c_str());
break;
@@
-584,9
+592,9
@@
RESULT eServiceFactoryDVB::info(const eServiceReference &ref, ePtr<iStaticServic
if ((ref.flags & eServiceReference::flagDirectory) == eServiceReference::flagDirectory) // bouquet
{
if ( !ref.name.empty() ) // satellites or providers list
if ((ref.flags & eServiceReference::flagDirectory) == eServiceReference::flagDirectory) // bouquet
{
if ( !ref.name.empty() ) // satellites or providers list
- ptr =
new eStaticServiceDVBInformation
;
+ ptr =
m_StaticServiceDVBInfo
;
else // a dvb bouquet
else // a dvb bouquet
- ptr =
new eStaticServiceDVBBouquetInformation
;
+ ptr =
m_StaticServiceDVBBouquetInfo
;
}
else if (!ref.path.empty()) /* do we have a PVR service? */
ptr = new eStaticServiceDVBPVRInformation(ref);
}
else if (!ref.path.empty()) /* do we have a PVR service? */
ptr = new eStaticServiceDVBPVRInformation(ref);
@@
-594,7
+602,7
@@
RESULT eServiceFactoryDVB::info(const eServiceReference &ref, ePtr<iStaticServic
{
ePtr<eDVBService> service;
if (lookupService(service, ref)) // no eDVBService avail for this reference ( Linkage Services... )
{
ePtr<eDVBService> service;
if (lookupService(service, ref)) // no eDVBService avail for this reference ( Linkage Services... )
- ptr =
new eStaticServiceDVBInformation
;
+ ptr =
m_StaticServiceDVBInfo
;
else
/* eDVBService has the iStaticServiceInformation interface, so we pass it here. */
ptr = service;
else
/* eDVBService has the iStaticServiceInformation interface, so we pass it here. */
ptr = service;
@@
-823,7
+831,12
@@
RESULT eDVBServicePlay::stop()
m_service_handler.free();
if (m_is_pvr && m_cuesheet_changed)
m_service_handler.free();
if (m_is_pvr && m_cuesheet_changed)
- saveCuesheet();
+ {
+ struct stat s;
+ /* save cuesheet only when main file is accessible. */
+ if (!::stat(m_reference.path.c_str(), &s))
+ saveCuesheet();
+ }
return 0;
}
return 0;
}
@@
-1191,7
+1204,7
@@
int eDVBServicePlay::getInfo(int w)
case sIsCrypted: return program.isCrypted();
case sVideoPID: if (program.videoStreams.empty()) return -1; return program.videoStreams[0].pid;
case sVideoType: if (program.videoStreams.empty()) return -1; return program.videoStreams[0].type;
case sIsCrypted: return program.isCrypted();
case sVideoPID: if (program.videoStreams.empty()) return -1; return program.videoStreams[0].pid;
case sVideoType: if (program.videoStreams.empty()) return -1; return program.videoStreams[0].type;
- case sAudioPID: if (program.audioStreams.empty()) return -1; return program.audioStreams[
m_current_audio_stream
].pid;
+ case sAudioPID: if (program.audioStreams.empty()) return -1; return program.audioStreams[
0
].pid;
case sPCRPID: return program.pcrPid;
case sPMTPID: return program.pmtPid;
case sTXTPID: return program.textPid;
case sPCRPID: return program.pcrPid;
case sPMTPID: return program.pmtPid;
case sTXTPID: return program.textPid;
@@
-1319,8
+1332,6
@@
int eDVBServicePlay::selectAudioStream(int i)
}
}
}
}
- m_current_audio_stream = i;
-
return 0;
}
return 0;
}
@@
-1629,9
+1640,11
@@
void eDVBServicePlay::switchToLive()
m_decode_demux = 0;
m_teletext_parser = 0;
m_radiotext_parser = 0;
m_decode_demux = 0;
m_teletext_parser = 0;
m_radiotext_parser = 0;
+ m_subtitle_parser = 0;
+ m_new_dvb_subtitle_region_connection = 0;
m_new_subtitle_page_connection = 0;
m_radiotext_updated_connection = 0;
m_new_subtitle_page_connection = 0;
m_radiotext_updated_connection = 0;
-
+
/* free the timeshift service handler, we need the resources */
m_service_handler_timeshift.free();
m_timeshift_active = 0;
/* free the timeshift service handler, we need the resources */
m_service_handler_timeshift.free();
m_timeshift_active = 0;
@@
-1650,7
+1663,9
@@
void eDVBServicePlay::switchToTimeshift()
m_decoder = 0;
m_teletext_parser = 0;
m_radiotext_parser = 0;
m_decoder = 0;
m_teletext_parser = 0;
m_radiotext_parser = 0;
+ m_subtitle_parser = 0;
m_new_subtitle_page_connection = 0;
m_new_subtitle_page_connection = 0;
+ m_new_dvb_subtitle_region_connection = 0;
m_radiotext_updated_connection = 0;
m_timeshift_active = 1;
m_radiotext_updated_connection = 0;
m_timeshift_active = 1;
@@
-1675,7
+1690,7
@@
void eDVBServicePlay::updateDecoder()
std::string default_ac3;
if (!ePythonConfigQuery::getConfigValue("config.av.defaultac3", default_ac3))
std::string default_ac3;
if (!ePythonConfigQuery::getConfigValue("config.av.defaultac3", default_ac3))
- defaultac3 = default_ac3 == "
enabl
e";
+ defaultac3 = default_ac3 == "
Tru
e";
eDVBServicePMTHandler::program program;
if (h.getProgramInfo(program))
eDVBServicePMTHandler::program program;
if (h.getProgramInfo(program))
@@
-1740,6
+1755,8
@@
void eDVBServicePlay::updateDecoder()
m_teletext_parser = new eDVBTeletextParser(m_decode_demux);
m_teletext_parser->connectNewPage(slot(*this, &eDVBServicePlay::newSubtitlePage), m_new_subtitle_page_connection);
#endif
m_teletext_parser = new eDVBTeletextParser(m_decode_demux);
m_teletext_parser->connectNewPage(slot(*this, &eDVBServicePlay::newSubtitlePage), m_new_subtitle_page_connection);
#endif
+ m_subtitle_parser = new eDVBSubtitleParser(m_decode_demux);
+ m_subtitle_parser->connectNewRegion(slot(*this, &eDVBServicePlay::newDVBSubtitleRegion), m_new_dvb_subtitle_region_connection);
}
if (m_decoder)
}
if (m_decoder)
@@
-1779,18
+1796,18
@@
void eDVBServicePlay::updateDecoder()
m_decoder->setPCMDelay(pcm_delay == -1 ? 0 : pcm_delay);
m_decoder->setVideoPID(vpid, vpidtype);
m_decoder->setPCMDelay(pcm_delay == -1 ? 0 : pcm_delay);
m_decoder->setVideoPID(vpid, vpidtype);
- m_current_audio_stream = 0;
m_decoder->setAudioPID(apid, apidtype);
if (!(m_is_pvr || m_timeshift_active || !m_is_primary))
{
m_decoder->setSyncPCR(pcrpid);
m_decoder->setAudioPID(apid, apidtype);
if (!(m_is_pvr || m_timeshift_active || !m_is_primary))
{
m_decoder->setSyncPCR(pcrpid);
- if (apid != 1)
+ if (apid !=
-
1)
{
ePtr<iDVBDemux> data_demux;
{
ePtr<iDVBDemux> data_demux;
- if (h.getDataDemux(data_demux))
+ if (
!
h.getDataDemux(data_demux))
{
m_radiotext_parser = new eDVBRadioTextParser(data_demux);
m_radiotext_parser->connectUpdatedRadiotext(slot(*this, &eDVBServicePlay::radioTextUpdated), m_radiotext_updated_connection);
{
m_radiotext_parser = new eDVBRadioTextParser(data_demux);
m_radiotext_parser->connectUpdatedRadiotext(slot(*this, &eDVBServicePlay::radioTextUpdated), m_radiotext_updated_connection);
+ m_radiotext_parser->start(apid);
}
}
}
}
}
}
@@
-1802,8
+1819,8
@@
void eDVBServicePlay::updateDecoder()
if (m_teletext_parser)
m_teletext_parser->start(tpid);
if (m_teletext_parser)
m_teletext_parser->start(tpid);
- if (m_
radiotext_parser
)
- m_
radiotext_parser->start(a
pid);
+ if (m_
subtitle_parser && program.subtitleStreams.size() > 0
)
+ m_
subtitle_parser->start(program.subtitleStreams[0].
pid);
if (!m_is_primary)
m_decoder->setTrickmode(1);
if (!m_is_primary)
m_decoder->setTrickmode(1);
@@
-2067,6
+2084,16
@@
void eDVBServicePlay::checkSubtitleTiming()
}
}
}
}
+void eDVBServicePlay::newDVBSubtitleRegion(const eDVBSubtitleRegion &p)
+{
+ eDebug("new dvb subtitle region");
+}
+
+void eDVBServicePlay::checkDvbSubtitleTiming()
+{
+ eDebug("check dvb subtitle timing");
+}
+
int eDVBServicePlay::getAC3Delay()
{
if (m_dvb_service)
int eDVBServicePlay::getAC3Delay()
{
if (m_dvb_service)