[MPlayer-cvslog] r22373 - trunk/libmpdemux/demux_rtp.cpp

nicodvb subversion at mplayerhq.hu
Tue Feb 27 23:25:01 CET 2007


Author: nicodvb
Date: Tue Feb 27 23:25:00 2007
New Revision: 22373

Modified:
   trunk/libmpdemux/demux_rtp.cpp

Log:
implementation of DEMUXER_CTRL_GET_TIME_LENGTH and DEMUXER_CTRL_GET_PERCENT_POS; patch by the usual Hoyos

Modified: trunk/libmpdemux/demux_rtp.cpp
==============================================================================
--- trunk/libmpdemux/demux_rtp.cpp	(original)
+++ trunk/libmpdemux/demux_rtp.cpp	Tue Feb 27 23:25:00 2007
@@ -581,6 +581,26 @@ demux_packet_t* ReadBufferQueue::getPend
   return dp;
 }
 
+static int demux_rtp_control(struct demuxer_st *demuxer, int cmd, void *arg) {
+  double endpts = ((RTPState*)demuxer->priv)->mediaSession->playEndTime();
+
+  switch(cmd) {
+    case DEMUXER_CTRL_GET_TIME_LENGTH:
+      if (endpts <= 0)
+        return DEMUXER_CTRL_DONTKNOW;
+      *((double *)arg) = endpts;
+      return DEMUXER_CTRL_OK;
+
+    case DEMUXER_CTRL_GET_PERCENT_POS:
+      if (endpts <= 0)
+        return DEMUXER_CTRL_DONTKNOW;
+      *((int *)arg) = (int)(((RTPState*)demuxer->priv)->videoBufferQueue->prevPacketPTS*100/endpts);
+      return DEMUXER_CTRL_OK;
+
+    default:
+      return DEMUXER_CTRL_NOTIMPL;
+    }
+}
 
 demuxer_desc_t demuxer_desc_rtp = {
   "LIVE555 RTP demuxer",
@@ -595,5 +615,5 @@ demuxer_desc_t demuxer_desc_rtp = {
   demux_open_rtp,
   demux_close_rtp,
   NULL,
-  NULL
+  demux_rtp_control
 };



More information about the MPlayer-cvslog mailing list