pipelka / xbmc-addon-xvdr

DISCONTINUED - Standalone XVDR addon for XBMC
GNU General Public License v2.0
43 stars 16 forks source link

Couldn't build with gcc6 #170

Closed knedlyk closed 8 years ago

knedlyk commented 8 years ago

Proposed patch:

diff -Naur vdr-plugin-xvdr/src/config/config.h vdr-plugin-xvdr.ok/src/config/config.h
--- vdr-plugin-xvdr/src/config/config.h 2016-10-04 02:28:52.502666109 +0200
+++ vdr-plugin-xvdr.ok/src/config/config.h  2016-10-04 01:56:10.000000000 +0200
@@ -34,19 +34,19 @@
 // log output configuration

 #ifdef CONSOLEDEBUG
-#define DEBUGLOG(x...) printf("XVDR: "x)
+#define DEBUGLOG(x...) printf("XVDR: " x)
 #elif defined  DEBUG
-#define DEBUGLOG(x...) dsyslog("XVDR: "x)
+#define DEBUGLOG(x...) dsyslog("XVDR: " x)
 #else
 #define DEBUGLOG(x...)
 #endif

 #ifdef CONSOLEDEBUG
-#define INFOLOG(x...) printf("XVDR: "x)
-#define ERRORLOG(x...) printf("XVDR-Error: "x)
+#define INFOLOG(x...) printf("XVDR: " x)
+#define ERRORLOG(x...) printf("XVDR-Error: " x)
 #else
-#define INFOLOG(x...) isyslog("XVDR: "x)
-#define ERRORLOG(x...) esyslog("XVDR-Error: "x)
+#define INFOLOG(x...) isyslog("XVDR: " x)
+#define ERRORLOG(x...) esyslog("XVDR-Error: " x)
 #endif

 // default settings
diff -Naur vdr-plugin-xvdr/src/live/livequeue.c vdr-plugin-xvdr.ok/src/live/livequeue.c
--- vdr-plugin-xvdr/src/live/livequeue.c    2016-10-04 02:28:52.512664853 +0200
+++ vdr-plugin-xvdr.ok/src/live/livequeue.c 2016-10-04 01:56:10.000000000 +0200
@@ -27,7 +27,7 @@
 #include <unistd.h>

 #include "config/config.h"
-#include "net/msgpacket.h"
+//#include "net/msgpacket.h"
 #include "livequeue.h"

 cString cLiveQueue::TimeShiftDir = "/video";
@@ -53,7 +53,7 @@
   while(!empty())
   {
     delete front();
-    pop();
+    pop_front();
   }
 }

@@ -81,7 +81,7 @@
     return;

   // put packet into queue
-  push(p);
+  push_back(p);

   m_cond.Signal();
 }
@@ -135,12 +135,12 @@
   }

   // add packet to queue
-  push(p);
+  push_back(p);

   // queue too long ?
   while (size() > m_queuesize) {
     p = front();
-    pop();
+    pop_front();
   }

   m_cond.Signal();
@@ -173,7 +173,7 @@
     if(size() > 0)
     {
       p = front();
-      pop();
+      pop_front();
     }

     m_lock.Unlock();
@@ -250,7 +250,7 @@
     p->write(m_writefd, 1000);
     delete p;

-    pop();
+    pop_front();
   }

   return true;
diff -Naur vdr-plugin-xvdr/src/live/livequeue.h vdr-plugin-xvdr.ok/src/live/livequeue.h
--- vdr-plugin-xvdr/src/live/livequeue.h    2016-10-04 02:28:52.512664853 +0200
+++ vdr-plugin-xvdr.ok/src/live/livequeue.h 2016-10-04 01:56:10.000000000 +0200
@@ -25,13 +25,15 @@
 #ifndef XVDR_LIVEQUEUE_H
 #define XVDR_LIVEQUEUE_H

-#include <queue>
+//#include <queue>
+#include <deque>
+#include "net/msgpacket.h"
 #include <vdr/thread.h>
 #include "demuxer/streaminfo.h"

-class MsgPacket;
+//class MsgPacket;

-class cLiveQueue : public cThread, protected std::queue<MsgPacket*>
+class cLiveQueue : public cThread, protected std::deque<MsgPacket*>
 {
 public:

diff -Naur vdr-plugin-xvdr/src/xvdr/xvdrclient.c vdr-plugin-xvdr.ok/src/xvdr/xvdrclient.c
--- vdr-plugin-xvdr/src/xvdr/xvdrclient.c   2016-10-04 02:28:52.522663595 +0200
+++ vdr-plugin-xvdr.ok/src/xvdr/xvdrclient.c    2016-10-04 01:56:10.000000000 +0200
@@ -43,7 +43,7 @@

 #include "config/config.h"
 #include "live/livestreamer.h"
-#include "net/msgpacket.h"
+//#include "net/msgpacket.h"
 #include "recordings/recordingscache.h"
 #include "recordings/recplayer.h"
 #include "tools/hash.h"
@@ -198,7 +198,7 @@
     cMutexLock lock(&m_queueLock);
     while(!m_queue.empty()) {
       MsgPacket* p = m_queue.front();
-      m_queue.pop();
+      m_queue.pop_front();
       delete p;
     }
   }
@@ -228,7 +228,7 @@
           break;
         }

-        m_queue.pop();
+        m_queue.pop_front();
         delete p;
       }
     }
@@ -2064,5 +2064,5 @@

 void cXVDRClient::QueueMessage(MsgPacket* p) {
   cMutexLock lock(&m_queueLock);
-  m_queue.push(p);
+  m_queue.push_back(p);
 }
diff -Naur vdr-plugin-xvdr/src/xvdr/xvdrclient.h vdr-plugin-xvdr.ok/src/xvdr/xvdrclient.h
--- vdr-plugin-xvdr/src/xvdr/xvdrclient.h   2016-10-04 02:28:52.522663595 +0200
+++ vdr-plugin-xvdr.ok/src/xvdr/xvdrclient.h    2016-10-04 01:56:10.000000000 +0200
@@ -29,7 +29,8 @@
 #include <map>
 #include <list>
 #include <string>
-#include <queue>
+//#include <queue>
+#include <deque>
 #include <set>

 #include <vdr/thread.h>
@@ -40,10 +41,12 @@
 #include "demuxer/streaminfo.h"
 #include "scanner/wirbelscan.h"

+#include "net/msgpacket.h"
+
 class cChannel;
 class cDevice;
 class cLiveStreamer;
-class MsgPacket;
+//class MsgPacket;
 class cRecPlayer;
 class cCmdControl;

@@ -77,7 +80,7 @@
   bool              m_scanSupported;
   std::string       m_clientName;

-  std::queue<MsgPacket*> m_queue;
+  std::deque<MsgPacket*> m_queue;
   cMutex                 m_queueLock;

 protected: