Support scrambled playback.
[vuplus_dvbapp] / lib / dvb / dvb.cpp
index 756c685..bc79306 100644 (file)
@@ -2035,7 +2035,8 @@ RESULT eDVBChannel::playSource(ePtr<iTsSource> &source, const char *streaminfo_f
                return -ENOENT;
        }
 
-       m_tstools.setSource(source, streaminfo_file);
+       m_source = source;
+       m_tstools.setSource(m_source, streaminfo_file);
 
                /* DON'T EVEN THINK ABOUT FIXING THIS. FIX THE ATI SOURCES FIRST,
                   THEN DO A REAL FIX HERE! */
@@ -2072,12 +2073,12 @@ RESULT eDVBChannel::playSource(ePtr<iTsSource> &source, const char *streaminfo_f
        m_pvr_thread = new eDVBChannelFilePush();
        m_pvr_thread->enablePVRCommit(1);
        /* If the source specifies a length, it's a file. If not, it's a stream */
-       m_pvr_thread->setStreamMode(source->isStream());
+       m_pvr_thread->setStreamMode(m_source->isStream());
        m_pvr_thread->setScatterGather(this);
 
        m_event(this, evtPreStart);
 
-       m_pvr_thread->start(source, m_pvr_fd_dst);
+       m_pvr_thread->start(m_source, m_pvr_fd_dst);
        CONNECT(m_pvr_thread->m_event, eDVBChannel::pvrEvent);
 
        m_state = state_ok;
@@ -2099,8 +2100,9 @@ void eDVBChannel::stopSource()
                ::close(m_pvr_fd_dst);
                m_pvr_fd_dst = -1;
        }
-       ePtr<iTsSource> d;
-       m_tstools.setSource(d);
+
+       m_source = NULL;
+       m_tstools.setSource(m_source);
 }
 
 void eDVBChannel::stopFile()
@@ -2141,8 +2143,7 @@ RESULT eDVBChannel::getCurrentPosition(iDVBDemux *decoding_demux, pts_t &pos, in
        } else
                now = pos; /* fixup supplied */
 
-       off_t off = 0; /* TODO: fixme */
-       r = m_tstools.fixupPTS(off, now);
+       r = m_tstools.fixupPTS(m_source ? m_source->offset() : 0, now);
        if (r)
        {
                eDebug("fixup PTS failed");