add new tuneExt function to eDVBServicePMTHandler to make the class more reusable
authorghost <andreas.monzner@multimedia-labs.de>
Wed, 10 Nov 2010 16:18:45 +0000 (17:18 +0100)
committerghost <andreas.monzner@multimedia-labs.de>
Wed, 10 Nov 2010 16:18:45 +0000 (17:18 +0100)
lib/dvb/pmt.cpp
lib/dvb/pmt.h

index ea4b96c..ba5a3ad 100644 (file)
@@ -675,6 +675,12 @@ void eDVBServicePMTHandler::SDTScanEvent(int event)
 
 int eDVBServicePMTHandler::tune(eServiceReferenceDVB &ref, int use_decode_demux, eCueSheet *cue, bool simulate, eDVBService *service)
 {
 
 int eDVBServicePMTHandler::tune(eServiceReferenceDVB &ref, int use_decode_demux, eCueSheet *cue, bool simulate, eDVBService *service)
 {
+       ePtr<iDataSource> s;
+       return tuneExt(ref, use_decode_demux, s, cue, simulate, service);
+}
+
+int eDVBServicePMTHandler::tuneExt(eServiceReferenceDVB &ref, int use_decode_demux, ePtr<iDataSource> &source, eCueSheet *cue, bool simulate, eDVBService *service)
+{
        RESULT res=0;
        m_reference = ref;
        
        RESULT res=0;
        m_reference = ref;
        
@@ -757,7 +763,10 @@ int eDVBServicePMTHandler::tune(eServiceReferenceDVB &ref, int use_decode_demux,
                if (m_pvr_channel)
                {
                        m_pvr_channel->setCueSheet(cue);
                if (m_pvr_channel)
                {
                        m_pvr_channel->setCueSheet(cue);
-                       m_pvr_channel->playFile(ref.path.c_str());
+                       if (source)
+                               m_pvr_channel->playSource(source);
+                       else
+                               m_pvr_channel->playFile(ref.path.c_str());
                }
        }
 
                }
        }
 
index 483c06b..0ea36e4 100644 (file)
@@ -206,6 +206,8 @@ public:
        void resetCachedProgram() { m_have_cached_program = false; }
 
        int tune(eServiceReferenceDVB &ref, int use_decode_demux, eCueSheet *sg=0, bool simulate=false, eDVBService *service = 0);
        void resetCachedProgram() { m_have_cached_program = false; }
 
        int tune(eServiceReferenceDVB &ref, int use_decode_demux, eCueSheet *sg=0, bool simulate=false, eDVBService *service = 0);
+       int tuneExt(eServiceReferenceDVB &ref, int use_decode_demux, ePtr<iDataSource> &, eCueSheet *sg=0, bool simulate=false, eDVBService *service = 0);
+
        void free();
 private:
        bool m_have_cached_program;
        void free();
 private:
        bool m_have_cached_program;