summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2009-08-01 19:50:36 +0000
committerphintuka <phintuka>2009-08-01 19:50:36 +0000
commitc62fd5ecf5b51c27a192dbe5d2bf6c2bea47f6c6 (patch)
tree4493b85511514af55643669a5a2ee620370dc154
parentef474e91da04926947a62d4144c2ad14f5c5fd21 (diff)
downloadxineliboutput-c62fd5ecf5b51c27a192dbe5d2bf6c2bea47f6c6.tar.gz
xineliboutput-c62fd5ecf5b51c27a192dbe5d2bf6c2bea47f6c6.tar.bz2
Moved double clear check from cXinelibDevice to cXinelibThread
-rw-r--r--device.c22
-rw-r--r--device.h3
-rw-r--r--frontend.c30
-rw-r--r--frontend.h3
4 files changed, 26 insertions, 32 deletions
diff --git a/device.c b/device.c
index a682519e..4a2af909 100644
--- a/device.c
+++ b/device.c
@@ -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) {
diff --git a/device.h b/device.h
index 04f23f52..c75ee10b 100644
--- a/device.h
+++ b/device.h
@@ -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);
diff --git a/frontend.c b/frontend.c
index 9a45d2c7..67975ad4 100644
--- a/frontend.c
+++ b/frontend.c
@@ -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;
}
diff --git a/frontend.h b/frontend.h
index a80c5b9b..ef9f4f73 100644
--- a/frontend.h
+++ b/frontend.h
@@ -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;