[vlc-commits] RTP: use stream_DemuxControl() - fixes #3145

Rémi Denis-Courmont git at videolan.org
Tue Aug 21 17:32:56 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Aug 21 18:23:36 2012 +0300| [1ffe7f9e67e21a3a270462d61250ee4a4bde8cd9] | committer: Rémi Denis-Courmont

RTP: use stream_DemuxControl() - fixes #3145

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1ffe7f9e67e21a3a270462d61250ee4a4bde8cd9
---

 modules/access/rtp/rtp.c |   42 +++++++++++++++++++++++++-----------------
 1 file changed, 25 insertions(+), 17 deletions(-)

diff --git a/modules/access/rtp/rtp.c b/modules/access/rtp/rtp.c
index 981b544..31e39c2 100644
--- a/modules/access/rtp/rtp.c
+++ b/modules/access/rtp/rtp.c
@@ -372,25 +372,12 @@ static int extract_port (char **phost)
 /**
  * Control callback
  */
-static int Control (demux_t *demux, int i_query, va_list args)
+static int Control (demux_t *demux, int query, va_list args)
 {
-    switch (i_query)
-    {
-        case DEMUX_GET_POSITION:
-        {
-            float *v = va_arg (args, float *);
-            *v = 0.;
-            return VLC_SUCCESS;
-        }
-
-        case DEMUX_GET_LENGTH:
-        case DEMUX_GET_TIME:
-        {
-            int64_t *v = va_arg (args, int64_t *);
-            *v = 0;
-            return VLC_SUCCESS;
-        }
+    demux_sys_t *sys = demux->p_sys;
 
+    switch (query)
+    {
         case DEMUX_GET_PTS_DELAY:
         {
             int64_t *v = va_arg (args, int64_t *);
@@ -408,6 +395,27 @@ static int Control (demux_t *demux, int i_query, va_list args)
         }
     }
 
+    if (sys->chained_demux != NULL)
+        return stream_DemuxControlVa (sys->chained_demux, query, args);
+
+    switch (query)
+    {
+        case DEMUX_GET_POSITION:
+        {
+            float *v = va_arg (args, float *);
+            *v = 0.;
+            return VLC_SUCCESS;
+        }
+
+        case DEMUX_GET_LENGTH:
+        case DEMUX_GET_TIME:
+        {
+            int64_t *v = va_arg (args, int64_t *);
+            *v = 0;
+            return VLC_SUCCESS;
+        }
+    }
+
     return VLC_EGENERIC;
 }
 



More information about the vlc-commits mailing list