diff options
| author | ghost <andreas.monzner@multimedia-labs.de> | 2008-11-17 19:23:02 +0100 |
|---|---|---|
| committer | ghost <andreas.monzner@multimedia-labs.de> | 2008-11-17 19:23:02 +0100 |
| commit | 5eb41508927a7f48d09d52e158e136fa07252dac (patch) | |
| tree | f5ce5ebbc380e903eda85d37b0a5ff503f4fea3d /lib/service/servicedvb.cpp | |
| parent | 94913d0f73c36623ae19916d79cee759b7f6bc98 (diff) | |
| parent | 8cf7cff9fc9cde4d7add449478b8b35103325295 (diff) | |
| download | enigma2-5eb41508927a7f48d09d52e158e136fa07252dac.tar.gz enigma2-5eb41508927a7f48d09d52e158e136fa07252dac.zip | |
Merge branch 'master' into async_picload
Diffstat (limited to 'lib/service/servicedvb.cpp')
| -rw-r--r-- | lib/service/servicedvb.cpp | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp index 6c1e46f7..4141236a 100644 --- a/lib/service/servicedvb.cpp +++ b/lib/service/servicedvb.cpp @@ -31,8 +31,6 @@ #error no byte order defined! #endif -#define TSPATH "/media/hdd" - class eStaticServiceDVBInformation: public iStaticServiceInformation { DECLARE_REF(eStaticServiceDVBInformation); @@ -1494,9 +1492,16 @@ RESULT eDVBServicePlay::timeshift(ePtr<iTimeshiftService> &ptr) { 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; @@ -2114,12 +2119,23 @@ RESULT eDVBServicePlay::startTimeshift() 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; |
