aboutsummaryrefslogtreecommitdiff
path: root/lib/dvb/decoder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dvb/decoder.cpp')
-rw-r--r--lib/dvb/decoder.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/dvb/decoder.cpp b/lib/dvb/decoder.cpp
index 28d877df..b7118558 100644
--- a/lib/dvb/decoder.cpp
+++ b/lib/dvb/decoder.cpp
@@ -92,6 +92,12 @@ void eDVBAudio::stopPid()
eWarning("audio: DMX_STOP: %m");
}
#endif
+
+void eDVBAudio::flush()
+{
+ if (::ioctl(m_fd, AUDIO_CLEAR_BUFFER) < 0)
+ eDebug("audio: AUDIO_CLEAR_BUFFER: %m");
+}
eDVBAudio::~eDVBAudio()
{
@@ -171,6 +177,12 @@ void eDVBVideo::stopPid()
}
#endif
+void eDVBVideo::flush()
+{
+ if (::ioctl(m_fd, VIDEO_CLEAR_BUFFER) < 0)
+ eDebug("video: VIDEO_CLEAR_BUFFER: %m");
+}
+
eDVBVideo::~eDVBVideo()
{
if (m_fd >= 0)
@@ -342,6 +354,7 @@ int eTSMPEGDecoder::setState()
eTSMPEGDecoder::eTSMPEGDecoder(eDVBDemux *demux, int decoder): m_demux(demux), m_changed(0)
{
+ demux->connectEvent(slot(*this, &eTSMPEGDecoder::demux_event), m_demux_event);
}
eTSMPEGDecoder::~eTSMPEGDecoder()
@@ -421,3 +434,24 @@ RESULT eTSMPEGDecoder::setZoom(int what)
{
return -1;
}
+
+RESULT eTSMPEGDecoder::flush()
+{
+ if (m_audio)
+ m_audio->flush();
+ if (m_video)
+ m_video->flush();
+ return 0;
+}
+
+void eTSMPEGDecoder::demux_event(int event)
+{
+ switch (event)
+ {
+ case eDVBDemux::evtFlush:
+ flush();
+ break;
+ default:
+ break;
+ }
+}