summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--frontend_svr.c10
-rw-r--r--tools/udp_buffer.h7
-rw-r--r--tools/udp_pes_scheduler.c14
-rw-r--r--tools/udp_pes_scheduler.h4
4 files changed, 18 insertions, 17 deletions
diff --git a/frontend_svr.c b/frontend_svr.c
index 4eeb0ead..b9447ff0 100644
--- a/frontend_svr.c
+++ b/frontend_svr.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: frontend_svr.c,v 1.90 2010-03-13 12:20:06 phintuka Exp $
+ * $Id: frontend_svr.c,v 1.91 2010-03-14 11:50:51 phintuka Exp $
*
*/
@@ -453,7 +453,7 @@ int cXinelibServer::Play(const uchar *data, int len, eStreamId StreamId)
RtpClients = (m_iMulticastMask || xc.remote_rtp_always_on);
if(UdpClients || RtpClients)
- if(! m_Scheduler->Queue(m_StreamPos, data, len))
+ if(! m_Scheduler->Queue(StreamId, m_StreamPos, data, len))
LOGMSG("cXinelibServer::Play Buffer overflow (UDP/RTP)");
if(TcpClients || UdpClients || RtpClients)
@@ -653,7 +653,7 @@ int cXinelibServer::Xine_Control_Sync(const char *cmd)
RtpClients = (m_iMulticastMask || xc.remote_rtp_always_on);
if(UdpClients || RtpClients)
- if(! m_Scheduler->Queue((uint64_t)(-1ULL), (const uchar*)buf, len))
+ if(! m_Scheduler->Queue(sidControl, (uint64_t)(-1ULL), (const uchar*)buf, len))
LOGMSG("cXinelibServer::Xine_Control_Sync overflow (UDP/RTP)");
}
@@ -1094,7 +1094,7 @@ void cXinelibServer::Handle_Control_RTP(int cli, const char *arg)
// Client uses first received UDP/RTP packet to test connection.
m_Scheduler->QueuePadding();
if (m_Header)
- m_Scheduler->Queue(0, m_Header, m_HeaderLength);
+ m_Scheduler->Queue(sidVdr, 0, m_Header, m_HeaderLength);
}
void cXinelibServer::Handle_Control_UDP(int cli, const char *arg)
@@ -1125,7 +1125,7 @@ void cXinelibServer::Handle_Control_UDP(int cli, const char *arg)
// Client uses first received UDP/RTP packet to test connection.
m_Scheduler->QueuePadding();
if (m_Header)
- m_Scheduler->Queue(0, m_Header, m_HeaderLength);
+ m_Scheduler->Queue(sidVdr, 0, m_Header, m_HeaderLength);
}
void cXinelibServer::Handle_Control_KEY(int cli, const char *arg)
diff --git a/tools/udp_buffer.h b/tools/udp_buffer.h
index 6044b794..76bebf1d 100644
--- a/tools/udp_buffer.h
+++ b/tools/udp_buffer.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: udp_buffer.h,v 1.6 2009-03-24 19:35:23 phintuka Exp $
+ * $Id: udp_buffer.h,v 1.7 2010-03-14 11:50:50 phintuka Exp $
*
*/
@@ -85,8 +85,8 @@ class cUdpBackLog
return m_UdpBuffer[BufIndex] ? m_PayloadSize[BufIndex] : 0;
}
- stream_rtp_header_impl_t *MakeFrame(uint64_t StreamPos,
- const uchar *Data, int DataLen)
+ stream_rtp_header_impl_t *MakeFrame(eStreamId StreamId, uint64_t StreamPos,
+ const uchar *Data, int DataLen)
{
int UdpPacketLen = DataLen + sizeof(stream_rtp_header_impl_t);
int BufIndex = m_SeqNo & UDP_BUFFER_MASK;
@@ -130,6 +130,7 @@ class cUdpBackLog
// UDP header
header->hdr_ext.pos = htonull(StreamPos);
header->hdr_ext.seq = htons(m_SeqNo);
+ header->hdr_ext.stream = (uint8_t)StreamId;
header->hdr_ext.padding1 = 0;
diff --git a/tools/udp_pes_scheduler.c b/tools/udp_pes_scheduler.c
index d46a99a8..6ccf55a3 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.52 2009-08-19 12:19:43 phintuka Exp $
+ * $Id: udp_pes_scheduler.c,v 1.53 2010-03-14 11:50:50 phintuka Exp $
*
*/
@@ -430,18 +430,18 @@ void cUdpScheduler::SetScrSpeed(const int Speed)
m_RtpScr.SetScrSpeed(Speed);
}
-bool cUdpScheduler::Queue(uint64_t StreamPos, const uchar *Data, int Length)
+bool cUdpScheduler::Queue(eStreamId StreamId, uint64_t StreamPos, const uchar *Data, int Length)
{
cMutexLock ml(&m_Lock);
- if(m_Handles[0] < 0)
+ if(m_Handles[0] < 0)
return true;
uint limit = m_Master ? MAX_QUEUE_SIZE : MAX_LIVE_QUEUE_SIZE;
if(m_QueuePending >= limit)
return false;
- m_BackLog->MakeFrame(StreamPos, Data, Length);
+ m_BackLog->MakeFrame(StreamId, StreamPos, Data, Length);
m_QueuePending++;
m_Cond.Broadcast();
@@ -473,9 +473,9 @@ void cUdpScheduler::QueuePaddingInternal(void)
if (Frame) {
int PrevLen = m_BackLog->PayloadSize(PrevSeq);
uint64_t Pos = ntohll(Frame->hdr_ext.pos) + PrevLen - 8;
- m_BackLog->MakeFrame(Pos, Padding, 8);
+ m_BackLog->MakeFrame(sidPadding, Pos, Padding, 8);
} else
- m_BackLog->MakeFrame(0, Padding, 8);
+ m_BackLog->MakeFrame(sidPadding, 0, Padding, 8);
m_QueuePending++;
}
@@ -778,7 +778,7 @@ void cUdpScheduler::Action(void)
m_Lock.Unlock();
// Schedule frame
- if(m_Master)
+ if(m_Master && eStreamId(frame->hdr_ext.stream) == sidVdr)
Schedule(frame->payload, PayloadSize);
// Need some bandwidth limit for ex. sequence of still frames when
diff --git a/tools/udp_pes_scheduler.h b/tools/udp_pes_scheduler.h
index 99f1861b..515d5a15 100644
--- a/tools/udp_pes_scheduler.h
+++ b/tools/udp_pes_scheduler.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: udp_pes_scheduler.h,v 1.22 2009-08-19 11:32:21 phintuka Exp $
+ * $Id: udp_pes_scheduler.h,v 1.23 2010-03-14 11:50:50 phintuka Exp $
*
*/
@@ -40,7 +40,7 @@ class cUdpScheduler : public cThread
bool Clients(void) { return m_Handles[0] >= 0; }
int Poll(int TimeoutMs, bool Master);
- bool Queue(uint64_t StreamPos, const uchar *Data, int Length);
+ bool Queue(eStreamId StreamId, uint64_t StreamPos, const uchar *Data, int Length);
void QueuePadding(void);
void ReSend(int fd, uint64_t Pos, int Seq1, int Seq2);