diff options
author | phintuka <phintuka> | 2006-12-15 21:34:18 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2006-12-15 21:34:18 +0000 |
commit | 93b827c977b745ec581afbb8d4b0c2dd3c7a367f (patch) | |
tree | df3e071af21a02feba0f6ad0ee351d0d7b5a94e3 | |
parent | 2a6809ca69f40948a36edc068e689a53fdf0cff0 (diff) | |
download | xineliboutput-93b827c977b745ec581afbb8d4b0c2dd3c7a367f.tar.gz xineliboutput-93b827c977b745ec581afbb8d4b0c2dd3c7a367f.tar.bz2 |
Fix max. queue fill level in Queue().
(Queue() must accept at least one frame if previous Poll() returned true).
-rw-r--r-- | tools/udp_pes_scheduler.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/udp_pes_scheduler.c b/tools/udp_pes_scheduler.c index 93e9c32b..9f2d5381 100644 --- a/tools/udp_pes_scheduler.c +++ b/tools/udp_pes_scheduler.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: udp_pes_scheduler.c,v 1.14 2006-12-14 18:54:41 phintuka Exp $ + * $Id: udp_pes_scheduler.c,v 1.15 2006-12-15 21:34:18 phintuka Exp $ * */ @@ -463,7 +463,7 @@ bool cUdpScheduler::Poll(int TimeoutMs, bool Master) return true; } - const int limit = m_Master ? MAX_QUEUE_SIZE : MAX_LIVE_QUEUE_SIZE; + int limit = m_Master ? MAX_QUEUE_SIZE : MAX_LIVE_QUEUE_SIZE; if(m_QueuePending >= limit) { uint64_t WaitEnd = cTimeMs::Now(); if(TimeoutMs >= 0) @@ -541,7 +541,8 @@ bool cUdpScheduler::Queue(uint64_t StreamPos, const uchar *Data, int Length) if(m_Handles[0] < 0) return true; - if(m_QueuePending >= MAX_QUEUE_SIZE) + int limit = m_Master ? MAX_QUEUE_SIZE : MAX_LIVE_QUEUE_SIZE; + if(m_QueuePending >= limit) return false; m_BackLog->MakeFrame(StreamPos, Data, Length); |