Mailing List archive

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

[vdr] vdr-1.3.13: buffer overflows and vdr-xine



Hi,

for any reason there are still some problems with the new buffer handling. I'd suggest the following change to transfer.c:

--- vdr-1.3.13-orig/transfer.c 2004-10-16 11:22:58.000000000 +0200
+++ vdr-1.3.13/transfer.c 2004-10-20 13:21:40.778696440 +0200
@@ -65,7 +75,7 @@
int Count;
uchar *b = ringBuffer->Get(Count);
if (b) {
- if (Count > TRANSFERBUFSIZE * 2 / 3) {
+ if (ringBuffer->Available() > TRANSFERBUFSIZE * 2 / 3) {
// If the buffer runs full, we have no chance of ever catching up
// since the data comes in at the same rate as it goes out (it's "live").
// So let's clear the buffer instead of suffering from permanent

For an explanation consider the following case: ringBuffer contains already data of a size greater than margin near the end of the buffer. Therefore Count will only contain the size of data till the end of the buffer. But the receiver thread keeps going on to put data into ringBuffer. The result were buffer overflows.

By considering all the data contained in ringBuffer by using it's method Available() a buffer clear will still happen even for this special case.

Next I'm looking into an issue why cRemux in not consuming any data in Put() but is also not delivering any data to cXineDevice::PlayVideo(). This is the main problem that triggered the above one.

Bye.
--
Dipl.-Inform. (FH) Reinhard Nissl
mailto:rnissl@gmx.de




Home | Main Index | Thread Index