]> git.vomp.tv Git - vompserver.git/commitdiff
VDR 1.2.6 compatibility
authorChris Tallon <chris@vomp.tv>
Sun, 18 Mar 2007 16:40:13 +0000 (16:40 +0000)
committerChris Tallon <chris@vomp.tv>
Sun, 18 Mar 2007 16:40:13 +0000 (16:40 +0000)
mvpclient.c
mvpreceiver.c

index 181eda9180e96cacde16a407eed441e2f6c53e3d..b10282d24aa8059f8e64de7a961e0914d10b756f 100644 (file)
@@ -610,11 +610,36 @@ int MVPClient::processGetChannelPids(UCHAR* data, int length)
   ULONG numApids = 0;
   ULONG spaceRequired = 12; // 4 for length field, 4 for vpid, 4 for number of apids
   // Work out space required and number of Apids
+
+#if VDRVERSNUM < 10300
+
+  log->log("Client", Log::DEBUG, "Apid1: %i", channel->Apid1());
+  log->log("Client", Log::DEBUG, "Apid2: %i", channel->Apid2());
+
+  if (channel->Apid2())
+  {
+    numApids = 2;
+    spaceRequired += 10; // 8 + 2 nulls
+  }
+  else if (channel->Apid1())
+  {
+    numApids = 1;
+    spaceRequired += 5; // 4 + 1 null
+  }
+  else
+  {
+    numApids = 0;
+  }
+
+#else
+
   for (const int *Apid = channel->Apids(); *Apid; Apid++)
   {
     spaceRequired += 4 + strlen(channel->Alang(numApids)) + 1; // 4 for pid, length of string + \0
     numApids++;
   }
+#endif
+
 
   // Format of response
   // vpid
@@ -630,13 +655,26 @@ int MVPClient::processGetChannelPids(UCHAR* data, int length)
   *(ULONG*)&sendBuffer[point] = htonl(channel->Vpid());     point += 4;
   *(ULONG*)&sendBuffer[point] = htonl(numApids);            point += 4;
 
+#if VDRVERSNUM < 10300
+  if (numApids >= 1)
+  {
+    *(ULONG*)&sendBuffer[point] = htonl(channel->Apid1());  point += 4;
+    sendBuffer[point] = '\0';                               point += 1;
+  }
+  if (numApids == 2)
+  {
+    *(ULONG*)&sendBuffer[point] = htonl(channel->Apid2());  point += 4;
+    sendBuffer[point] = '\0';                               point += 1;
+  }
+#else
   for (ULONG i = 0; i < numApids; i++)
   {
     *(ULONG*)&sendBuffer[point] = htonl(channel->Apid(i));  point += 4;
-    strcpy((char*)&sendBuffer[point], channel->Alang(i));          point += strlen(channel->Alang(i)) + 1;
+    strcpy((char*)&sendBuffer[point], channel->Alang(i));   point += strlen(channel->Alang(i)) + 1;
   }
+#endif
 
-  printf("About to send getchannelpids response. length = %u\n", spaceRequired);
+//  printf("About to send getchannelpids response. length = %u\n", spaceRequired);
   tcp.dump(sendBuffer, spaceRequired);
 
   tcp.sendPacket(sendBuffer, spaceRequired);
index f11308bfee170e9e9ee451aece9af95c9df45fbe..41c8a6ad48cbe909b91a3fa8ca41e4e05ee3d3d9 100755 (executable)
@@ -33,7 +33,7 @@ MVPReceiver::MVPReceiver(cChannel* channel, cDevice* device)
   vdrActivated = false;
   inittedOK = 0;
 
-  logger->log("MVPReceiver", Log::DEBUG, "Channel has VPID %i APID %i", channel->Vpid(), channel->Apid(0));
+//  logger->log("MVPReceiver", Log::DEBUG, "Channel has VPID %i APID %i", channel->Vpid(), channel->Apid(0));
 
   if (!processed.init(1000000)) return;
   pthread_mutex_init(&processedRingLock, NULL);