Bugfix: Write data to tsbuffer only if DvrOpen has been called. This avoids Buffer Overflow when not recording or viewing live.

This commit is contained in:
nafets227 2014-11-26 21:23:47 +01:00 committed by Rolf Ahrenberg
parent 6d68ef3e49
commit c966d28d13
1 changed files with 1 additions and 1 deletions

2
device.c Normal file → Executable file
View File

@ -408,7 +408,7 @@ void cSatipDevice::WriteData(uchar *bufferP, int lengthP)
{
//debug("cSatipDevice::%s(%u)", __FUNCTION__, deviceIndexM);
// Fill up TS buffer
if (tsBufferM) {
if (isOpenDvrM && tsBufferM) {
int len = tsBufferM->Put(bufferP, lengthP);
if (len != lengthP)
tsBufferM->ReportOverflow(lengthP - len);