diff options
-rw-r--r-- | device.c | 22 | ||||
-rw-r--r-- | device.h | 3 | ||||
-rw-r--r-- | frontend.c | 30 | ||||
-rw-r--r-- | frontend.h | 3 |
4 files changed, 26 insertions, 32 deletions
@@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: device.c,v 1.85 2009-07-25 20:40:45 phintuka Exp $ + * $Id: device.c,v 1.86 2009-08-01 19:50:36 phintuka Exp $ * */ @@ -211,7 +211,6 @@ cXinelibDevice::cXinelibDevice() m_RadioStream = false; m_AudioCount = 0; m_FreeBufs = 0; - m_Cleared = true; m_h264 = false; m_VideoSize = (video_size_t*)calloc(1, sizeof(video_size_t)); @@ -787,18 +786,12 @@ void cXinelibDevice::Clear(void) TsBufferClear(); - if(m_Cleared && m_StreamStart && m_TrickSpeed == -1) { - //LOGMSG("************ Double Clear ***************"); - } else { - //LOGMSG("************ FIRST Clear ***************"); - m_Cleared = true; - m_StreamStart = true; - m_h264 = false; - m_FreeBufs = 0; - TrickSpeed(-1); - ForEach(m_clients, &cXinelibThread::Clear); - ForEach(m_clients, &cXinelibThread::SetStillMode, false); - } + m_StreamStart = true; + m_h264 = false; + m_FreeBufs = 0; + TrickSpeed(-1); + ForEach(m_clients, &cXinelibThread::Clear); + ForEach(m_clients, &cXinelibThread::SetStillMode, false); } void cXinelibDevice::Play(void) @@ -1080,7 +1073,6 @@ int cXinelibDevice::PlayAny(const uchar *buf, int length) if (DATA_IS_PES(buf)) pes_change_pts((uchar*)buf, length, INT64_C(0)); } - m_Cleared = false; m_FreeBufs --; if(m_local) { @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: device.h,v 1.48 2009-06-24 20:43:45 phintuka Exp $ + * $Id: device.h,v 1.49 2009-08-01 19:50:36 phintuka Exp $ * */ @@ -228,7 +228,6 @@ class cXinelibDevice : public cDevice bool m_SkipAudio; bool m_StreamStart; int m_FreeBufs; - bool m_Cleared; bool m_h264; int PlayAny(const uchar *Data, int Length); @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend.c,v 1.69 2009-05-29 14:31:46 phintuka Exp $ + * $Id: frontend.c,v 1.70 2009-08-01 19:50:36 phintuka Exp $ * */ @@ -223,6 +223,7 @@ cXinelibThread::cXinelibThread(const char *Description) : cThread(Description) m_bNoVideo = true; m_bLiveMode = true; /* can't be replaying when there is no output device */ m_StreamPos = 0; + m_LastClearPos = 0; m_Frames = 0; m_bEndOfStreamReached = false; m_bPlayingFile = false; @@ -376,14 +377,21 @@ void cXinelibThread::Clear(void) { TRACEF("cXinelibThread::Clear"); - Lock(); - int64_t tmp1 = m_StreamPos; - uint32_t tmp2 = m_Frames; - Unlock(); - char buf[128]; - snprintf(buf, sizeof(buf), "DISCARD %" PRId64 " %d", tmp1, tmp2); - /* Send to control stream and data stream. If message is sent only to + + { + LOCK_THREAD; + + if (m_StreamPos == m_LastClearPos) { + //LOGDBG("cXinelibThread::Clear(): double Clear() ignored"); + return; + } + m_LastClearPos = m_StreamPos; + + snprintf(buf, sizeof(buf), "DISCARD %" PRId64 " %d", m_StreamPos, m_Frames); + } + + /* Send to control stream and data stream. If message is sent only to * control stream, and it is delayed, engine flush will be skipped. */ Xine_Control(buf); @@ -571,12 +579,6 @@ bool cXinelibThread::Play_Mpeg2_ES(const uchar *data, int len, int streamID) bool cXinelibThread::QueueBlankDisplay(void) { TRACEF("cXinelibThread::BlankDisplay"); -#if 0 - extern const unsigned char v_mpg_black[]; // black_720x576.c - extern const int v_mpg_black_length; - - Play_Mpeg2_ES(v_mpg_black, v_mpg_black_length, VIDEO_STREAM); -#endif Xine_Control_Sync("BLANK"); return true; } @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend.h,v 1.28 2009-03-20 18:26:23 phintuka Exp $ + * $Id: frontend.h,v 1.29 2009-08-01 19:50:36 phintuka Exp $ * */ @@ -147,6 +147,7 @@ class cXinelibThread : public cThread, public cListObject int m_Volume; cString m_FileName; uint64_t m_StreamPos; + uint64_t m_LastClearPos; uint32_t m_Frames; cStatus *m_StatusMonitor; |