fixes for old api
[enigma2.git] / lib / dvb / dvb.cpp
index 9a35561530629e40f497ca4c7ad59ca0cc9e94dc..e0df1dc1a889fde7a3a29a61f5d5be65082c016d 100644 (file)
@@ -74,7 +74,11 @@ eDVBAdapterLinux::eDVBAdapterLinux(int nr): m_nr(nr)
        {
                struct stat s;
                char filename[128];
+#if HAVE_DVB_API_VERSION < 3
+               sprintf(filename, "/dev/dvb/card%d/frontend%d", m_nr, num_fe);
+#else
                sprintf(filename, "/dev/dvb/adapter%d/frontend%d", m_nr, num_fe);
+#endif
                if (stat(filename, &s))
                        break;
                ePtr<eDVBFrontend> fe;
@@ -92,7 +96,11 @@ eDVBAdapterLinux::eDVBAdapterLinux(int nr): m_nr(nr)
        {
                struct stat s;
                char filename[128];
+#if HAVE_DVB_API_VERSION < 3
+               sprintf(filename, "/dev/dvb/card%d/demux%d", m_nr, num_demux);
+#else
                sprintf(filename, "/dev/dvb/adapter%d/demux%d", m_nr, num_demux);
+#endif
                if (stat(filename, &s))
                        break;
                ePtr<eDVBDemux> demux;
@@ -152,7 +160,11 @@ int eDVBAdapterLinux::exist(int nr)
 {
        struct stat s;
        char filename[128];
+#if HAVE_DVB_API_VERSION < 3
+       sprintf(filename, "/dev/dvb/card%d", nr);
+#else
        sprintf(filename, "/dev/dvb/adapter%d", nr);
+#endif
        if (!stat(filename, &s))
                return 1;
        return 0;
@@ -232,10 +244,13 @@ RESULT eDVBResourceManager::allocateChannel(const eDVBChannelID &channelid, ePtr
 {
                /* first, check if a channel is already existing. */
        
-       for (std::list<active_channel>::iterator i(m_active_channels.begin()); i != m_active_channels.end();)
+//     eDebug("allocate channel.. %04x:%04x", channelid.transport_stream_id.get(), channelid.original_network_id.get());
+       for (std::list<active_channel>::iterator i(m_active_channels.begin()); i != m_active_channels.end(); ++i)
        {
+//             eDebug("available channel.. %04x:%04x", i->m_channel_id.transport_stream_id.get(), i->m_channel_id.original_network_id.get());
                if (i->m_channel_id == channelid)
                {
+//                     eDebug("found shared channel..");
                        channel = i->m_channel;
                        return 0;
                }