path: root/lib/libdvbv5/dvb-dev-local.c
diff options
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2016-08-14 11:21:03 (GMT)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-09-13 22:12:04 (GMT)
commitaa939cd0d227fd834d8b261906c171bd0c9865a6 (patch)
tree1ee6efe1559ba833af8284bf491f4927772b26a3 /lib/libdvbv5/dvb-dev-local.c
parent570626f4cc19db94db9ff2a5851c2283cbd8f40b (diff)
dvbv5: use asynchronous read for dvbv5-daemon
When using dvbv5-zap on monitor mode, it loses packets over the network connection, even with two local machines. Change the logic to let the DVB reads be asynchronous: the dvbv5-daemon will now poll all open demux and dvr device nodes. When some data arrives there, it sends through the network. We're using a sufficiently large buffer there to avoid loses. This increases the delay, but, as we're already using the network, delays are unavoidable. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'lib/libdvbv5/dvb-dev-local.c')
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libdvbv5/dvb-dev-local.c b/lib/libdvbv5/dvb-dev-local.c
index bf69fd6..1e8d57f 100644
--- a/lib/libdvbv5/dvb-dev-local.c
+++ b/lib/libdvbv5/dvb-dev-local.c
@@ -553,8 +553,10 @@ static ssize_t dvb_local_read(struct dvb_open_descriptor *open_dev,
int fd = open_dev->fd;
ssize_t ret;
- if (dev->dvb_type != DVB_DEVICE_DEMUX && dev->dvb_type != DVB_DEVICE_DVR)
+ if (dev->dvb_type != DVB_DEVICE_DEMUX && dev->dvb_type != DVB_DEVICE_DVR) {
+ dvb_logerr("Trying to read from an invalid device type on fd #%d", fd);
return -EINVAL;
+ }
ret = read(fd, buf, count);
if (ret == -1) {

Privacy Policy