#error no byte order defined!
#endif
-#define TSPATH "/media/hdd"
-
class eStaticServiceDVBInformation: public iStaticServiceInformation
{
DECLARE_REF(eStaticServiceDVBInformation);
eDebug("could not create PyObject for %s", key);
}
-extern void PutToDict(ePyObject &dict, const char*key, const char *value);
+extern void PutToDict(ePyObject &dict, const char*key, const char *value); // defined in dvb/frontend.cpp
void PutSatelliteDataToDict(ePyObject &dict, eDVBFrontendParametersSatellite &feparm)
{
case eDVBFrontendParametersSatellite::RollOff::alpha_0_20: tmp="0.20"; break;
}
PutToDict(dict, "roll off", tmp);
- if (feparm.modulation == eDVBFrontendParametersSatellite::Modulation::M8PSK)
+ switch(feparm.pilot)
{
- switch(feparm.pilot)
- {
- case eDVBFrontendParametersSatellite::Pilot::On: tmp="ON"; break;
- case eDVBFrontendParametersSatellite::Pilot::Off: tmp="OFF"; break;
- default:
- case eDVBFrontendParametersSatellite::Pilot::Unknown: tmp="AUTO"; break;
- }
- PutToDict(dict, "pilot", tmp);
+ case eDVBFrontendParametersSatellite::Pilot::On: tmp="ON"; break;
+ case eDVBFrontendParametersSatellite::Pilot::Off: tmp="OFF"; break;
+ default:
+ case eDVBFrontendParametersSatellite::Pilot::Unknown: tmp="AUTO"; break;
}
+ PutToDict(dict, "pilot", tmp);
tmp="DVB-S2";
break;
}
{
if (!m_timeshift_enabled)
{
- /* we need enough diskspace */
+ /* query config path */
+ std::string tspath;
+ if(ePythonConfigQuery::getConfigValue("config.usage.timeshift_path", tspath) == -1){
+ eDebug("could not query ts path from config");
+ return -4;
+ }
+ tspath.append("/");
+ /* we need enough diskspace */
struct statfs fs;
- if (statfs(TSPATH "/.", &fs) < 0)
+ if (statfs(tspath.c_str(), &fs) < 0)
{
eDebug("statfs failed!");
return -2;
if (!m_record)
return -3;
- char templ[]=TSPATH "/timeshift.XXXXXX";
+ std::string tspath;
+ if(ePythonConfigQuery::getConfigValue("config.usage.timeshift_path", tspath) == -1){
+ eDebug("could not query ts path");
+ return -5;
+ }
+ tspath.append("/timeshift.XXXXXX");
+ char* templ;
+ templ = new char[tspath.length() + 1];
+ strcpy(templ, tspath.c_str());
+
m_timeshift_fd = mkstemp(templ);
- m_timeshift_file = templ;
-
+ m_timeshift_file = std::string(templ);
+
eDebug("recording to %s", templ);
-
+
+ delete [] templ;
+
if (m_timeshift_fd < 0)
{
m_record = 0;
for (std::multiset<struct cueEntry>::iterator i(m_cue_entries.begin()); i != m_cue_entries.end(); ++i)
{
ePyObject tuple = PyTuple_New(2);
- PyTuple_SetItem(tuple, 0, PyLong_FromLongLong(i->where));
- PyTuple_SetItem(tuple, 1, PyInt_FromLong(i->what));
+ PyTuple_SET_ITEM(tuple, 0, PyLong_FromLongLong(i->where));
+ PyTuple_SET_ITEM(tuple, 1, PyInt_FromLong(i->what));
PyList_Append(list, tuple);
Py_DECREF(tuple);
}
return 0;
}
+extern void PutToDict(ePyObject &dict, const char*key, ePyObject item); // defined in dvb/frontend.cpp
+
PyObject *eDVBServicePlay::getStreamingData()
{
eDVBServicePMTHandler::program program;
if (m_service_handler.getProgramInfo(program))
{
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
- PyObject *r = program.createPythonObject();
+ ePyObject r = program.createPythonObject();
ePtr<iDVBDemux> demux;
if (!m_service_handler.getDataDemux(demux))
{
uint8_t demux_id;
- demux->getCADemuxID(demux_id);
-
- PyDict_SetItemString(r, "demux", PyInt_FromLong(demux_id));
+ if (!demux->getCADemuxID(demux_id))
+ PutToDict(r, "demux", PyInt_FromLong(demux_id));
}
return r;