summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/udp_buffer.h7
-rw-r--r--tools/udp_pes_scheduler.c14
-rw-r--r--tools/udp_pes_scheduler.h4
3 files changed, 13 insertions, 12 deletions
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);