RESULT eDVBChannel::playFile(const char *file)
{
+ eRawFile *f = new eRawFile();
+ ePtr<iDataSource> source = f;
+
+ if (f->open(file) < 0)
+ {
+ eDebug("can't open PVR file %s (%m)", file);
+ return -ENOENT;
+ }
+
+ return playSource(source, file);
+}
+
+RESULT eDVBChannel::playSource(ePtr<iDataSource> &source, const char *streaminfo_file)
+{
ASSERT(!m_frontend);
if (m_pvr_thread)
{
m_pvr_thread = 0;
}
- eRawFile *f = new eRawFile();
- if (f->open(file) < 0)
+ if (!source->valid())
{
- eDebug("can't open PVR file %s (%m)", file);
+ eDebug("PVR source is not valid!");
return -ENOENT;
}
- ePtr<iDataSource> source = f;
- m_tstools.setSource(source, file);
+ m_tstools.setSource(source, streaminfo_file);
/* DON'T EVEN THINK ABOUT FIXING THIS. FIX THE ATI SOURCES FIRST,
THEN DO A REAL FIX HERE! */
return 0;
}
-void eDVBChannel::stopFile()
+void eDVBChannel::stopSource()
{
if (m_pvr_thread)
{
}
if (m_pvr_fd_dst >= 0)
::close(m_pvr_fd_dst);
+ ePtr<iDataSource> d;
+ m_tstools.setSource(d);
+}
+
+void eDVBChannel::stopFile()
+{
+ stopSource();
}
void eDVBChannel::setCueSheet(eCueSheet *cuesheet)