diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2006-05-21 21:19:15 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2006-05-21 21:19:15 +0000 |
| commit | 62210b10dacd736e348d14fe342342db748961ee (patch) | |
| tree | e050e44b5220fefc7ee939eef307f92d0d3e0fa1 /lib/dvb/demux.cpp | |
| parent | 457ccb7da5d147837110a6be85b7f2d041e1dcba (diff) | |
| download | enigma2-62210b10dacd736e348d14fe342342db748961ee.tar.gz enigma2-62210b10dacd736e348d14fe342342db748961ee.zip | |
use nonblocking IO for pes filtering
Diffstat (limited to 'lib/dvb/demux.cpp')
| -rw-r--r-- | lib/dvb/demux.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/lib/dvb/demux.cpp b/lib/dvb/demux.cpp index ca9736ce..c6d3b103 100644 --- a/lib/dvb/demux.cpp +++ b/lib/dvb/demux.cpp @@ -295,18 +295,23 @@ void eDVBPESReader::data(int) { while (1) { - __u8 data[4096]; + __u8 buffer[16384]; int r; - r = ::read(m_fd, data, 4096); + r = ::read(m_fd, buffer, 16384); if (!r) - break; + return; if(r < 0) { - eWarning("ERROR reading section - %m\n"); + if (errno == EAGAIN) /* ok */ + return; + eWarning("ERROR reading PES (fd=%d) - %m", m_fd); return; } + if (m_active) - m_read(data, r); + m_read(buffer, r); + else + eWarning("PES reader not active"); } } @@ -317,6 +322,8 @@ eDVBPESReader::eDVBPESReader(eDVBDemux *demux, eMainloop *context, RESULT &res): if (m_fd >= 0) { + ::ioctl(m_fd, DMX_SET_BUFFER_SIZE, 64*1024); + ::fcntl(m_fd, F_SETFL, O_NONBLOCK); m_notifier = new eSocketNotifier(context, m_fd, eSocketNotifier::Read, false); CONNECT(m_notifier->activated, eDVBPESReader::data); res = 0; @@ -362,6 +369,9 @@ RESULT eDVBPESReader::start(int pid) flt.flags = DMX_IMMEDIATE_START; res = ::ioctl(m_fd, DMX_SET_PES_FILTER, &flt); + + if (res) + eWarning("PES filter: DMX_SET_PES_FILTER - %m"); if (!res) m_active = 1; return res; |
