From ebf0803f8246a1a3390db06b66bdbe6557431c65 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 21 Aug 2010 15:48:57 +0200 Subject: [PATCH] libtriple: hack different notify sizes for subs and ttx into cDemux --- libtriple/dmx_td.cpp | 7 +++++-- libtriple/dmx_td.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libtriple/dmx_td.cpp b/libtriple/dmx_td.cpp index dac776a..fe9566b 100644 --- a/libtriple/dmx_td.cpp +++ b/libtriple/dmx_td.cpp @@ -88,6 +88,7 @@ bool cDemux::Open(DMX_CHANNEL_TYPE pes_type, void * /*hVideoBuffer*/, int uBuffe if (ioctl(fd, DEMUX_SET_BUFFER_SIZE, uBufferSize) < 0) fprintf(stderr, "cDemux::Open DEMUX_SET_BUFFER_SIZE failed (%m)\n"); } + buffersize = uBufferSize; return true; } @@ -348,13 +349,15 @@ bool cDemux::pesFilter(const unsigned short pid) break; case DMX_PES_CHANNEL: flt.unloader.unloader_type = UNLOADER_TYPE_PAYLOAD; - flt.unloader.threshold = 64; + if (buffersize <= 0x10000) // dvbsubtitle, instant delivery... + flt.unloader.threshold = 1; + else + flt.unloader.threshold = 8; // 1k, teletext flt.pesType = DMX_PES_OTHER; flt.output = OUT_MEMORY; default: flt.pesType = DMX_PES_OTHER; } - return (ioctl(fd, DEMUX_FILTER_PES_SET, &flt) >= 0); } diff --git a/libtriple/dmx_td.h b/libtriple/dmx_td.h index aba9ec8..f367586 100644 --- a/libtriple/dmx_td.h +++ b/libtriple/dmx_td.h @@ -28,6 +28,7 @@ class cDemux private: int num; int fd; + int buffersize; DMX_CHANNEL_TYPE dmx_type; std::vector pesfds; public: