fixes for old api
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 12 May 2005 14:37:56 +0000 (14:37 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 12 May 2005 14:37:56 +0000 (14:37 +0000)
lib/dvb/dvb.cpp

index d4cc462..e0df1dc 100644 (file)
@@ -74,7 +74,11 @@ eDVBAdapterLinux::eDVBAdapterLinux(int nr): m_nr(nr)
        {
                struct stat s;
                char filename[128];
        {
                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);
                sprintf(filename, "/dev/dvb/adapter%d/frontend%d", m_nr, num_fe);
+#endif
                if (stat(filename, &s))
                        break;
                ePtr<eDVBFrontend> fe;
                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];
        {
                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);
                sprintf(filename, "/dev/dvb/adapter%d/demux%d", m_nr, num_demux);
+#endif
                if (stat(filename, &s))
                        break;
                ePtr<eDVBDemux> demux;
                if (stat(filename, &s))
                        break;
                ePtr<eDVBDemux> demux;
@@ -152,7 +160,11 @@ int eDVBAdapterLinux::exist(int nr)
 {
        struct stat s;
        char filename[128];
 {
        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);
        sprintf(filename, "/dev/dvb/adapter%d", nr);
+#endif
        if (!stat(filename, &s))
                return 1;
        return 0;
        if (!stat(filename, &s))
                return 1;
        return 0;