libtriple: do not read from invalid dmx

This commit is contained in:
Stefan Seyfried
2014-02-23 14:38:58 +01:00
parent 043bde93c1
commit 3ff4fd923b

View File

@@ -270,6 +270,14 @@ int cDemux::Read(unsigned char *buff, int len, int timeout)
ufds.events = POLLIN;
ufds.revents = 0;
if (dmx_type == DMX_INVALID) /* happens, if too many DMX_TP are requested, because */
{ /* nobody checks the return value of Open or Start... */
lt_debug("%s #%d: DMX_INVALID\n", __func__, num);
usleep(timeout * 1000); /* rate-limit the debug message */
errno = EINVAL;
return -1;
}
if (P->measure)
{
if (timeout)