Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] PATCH: vdr-stream-0.1.0 and vdr-1.1.22



Hi,

the following patch prepares vdr-stream-0.1.0 for vdr-1.1.22

diff -rub vdr-1.1.22.orig/PLUGINS/src/stream-0.1.0/transceiver.c 
vdr-1.1.22/PLUGINS/src/stream-0.1.0/transceiver.c
--- vdr-1.1.22.orig/PLUGINS/src/stream-0.1.0/transceiver.c      Tue Nov  5 
22:48:21 2002
+++ vdr-1.1.22/PLUGINS/src/stream-0.1.0/transceiver.c   Thu Jan 30 12:08:38 
2003
@@ -12,7 +12,7 @@

 cStreamTransceiver::cStreamTransceiver(cStreamSocket *Socket, int Ca, int 
Vpid, int Apid):
                cReceiver(Ca, ChannelMode == MODE_FIXED ? 0 : -1, 2, Vpid, 
Apid),
-               ringBuffer(new cRingBufferLinear(VIDEOBUFSIZE, true)),
+               ringBuffer(new cRingBufferLinear(VIDEOBUFSIZE, 1, true)),
                socket(Socket),
                remux(new cRemux(Vpid, Apid, 0, 0, 0, true)),
                pictureType(NO_PICTURE),
@@ -50,12 +50,25 @@
        uchar data[MINVIDEODATA];
        active = true;
        int recvd = 0;
+       const uchar *rd;
+
        while (active) {
                socket->Accept();

-               int got;
-               if ((got = ringBuffer->Get(data + recvd, sizeof(data) - 
recvd)) > 0)
-                       recvd += got;
+               int get, got = 0;
+
+                rd = ringBuffer->Get(got);
+
+               if (rd && got > 0) {
+                  get = got;
+                  if (get > sizeof(data) - recvd)
+                    get = sizeof(data) - recvd;
+
+                 memcpy(data + recvd, rd, get);
+                 recvd += get;
+
+                  ringBuffer->Del(got);
+                } /* if */

                if (recvd > 0) {
                        int count = recvd;


@Sascha Volkenandt: Maybe, the memcpy() is not necessary (hopefully ;-), 
please have a look at Klaus new cRingBuffer!

Ciao,
Andreas
-- 
Andreas Kool (akool<nospam>@</nospam>akool.de * http://www.akool.de)
PGP: 3FBF2411 Fingerprint: B5 35 34 74 25 60 2A 7A  89 06 92 C4 08 BA A5 BD

Transmission of this message via the Microsoft Network is prohibited



--
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index