From 5583233e9e9afa9f0aa55f50cc5fa9a434623cb6 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 15 Jul 2012 11:44:16 +0200 Subject: [PATCH] spark,azbox: make demux FD nonblocking ...except for DMX_PSI_CHANNEL, which does not seem to expect that. --- azbox/dmx.cpp | 4 ++++ libspark/dmx.cpp | 3 +++ 2 files changed, 7 insertions(+) diff --git a/azbox/dmx.cpp b/azbox/dmx.cpp index 1353cfd..80d500a 100644 --- a/azbox/dmx.cpp +++ b/azbox/dmx.cpp @@ -95,6 +95,10 @@ bool cDemux::Open(DMX_CHANNEL_TYPE pes_type, void * /*hVideoBuffer*/, int uBuffe int flags = O_RDWR; if (fd > -1) lt_info("%s FD ALREADY OPENED? fd = %d\n", __FUNCTION__, fd); + + if (pes_type != DMX_PSI_CHANNEL) + flags |= O_NONBLOCK; + fd = open(devname[devnum], flags); if (fd < 0) { diff --git a/libspark/dmx.cpp b/libspark/dmx.cpp index 188fd5f..bc5c0c2 100644 --- a/libspark/dmx.cpp +++ b/libspark/dmx.cpp @@ -94,6 +94,9 @@ bool cDemux::Open(DMX_CHANNEL_TYPE pes_type, void * /*hVideoBuffer*/, int uBuffe int flags = O_RDWR; if (fd > -1) lt_info("%s FD ALREADY OPENED? fd = %d\n", __FUNCTION__, fd); + + if (pes_type != DMX_PSI_CHANNEL) + flags |= O_NONBLOCK; #if 0 if (pes_type == DMX_TP_CHANNEL) {