]> git.sesse.net Git - vlc/commitdiff
Fixed a big rtp demuxer.
authorLaurent Aimar <fenrir@videolan.org>
Tue, 2 Sep 2008 21:17:28 +0000 (23:17 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Tue, 2 Sep 2008 21:22:51 +0000 (23:22 +0200)
DEMUX_GET_PTS_DELAY should returns microsecond.

You should NOT remove caching to PTS to create PCR.
It was probably a workaround for the previous bug. It could explains
the problems with TS over RTP (for TS with small pcr/pts delay that is, not
created by VLC)

Implemented missing DEMUX_CAN_* query.

modules/demux/rtp.c

index e9f98412fe84f0d16a7699f8181bea8881d7e0ff..1d819b435223b2ff7c8f8d3ee5fbecdec5dd3825 100644 (file)
@@ -334,7 +334,7 @@ static int Control (demux_t *demux, int i_query, va_list args)
         {
             float *v = va_arg (args, float *);
             *v = 0.;
-            return 0;
+            return VLC_SUCCESS;
         }
 
         case DEMUX_GET_LENGTH:
@@ -342,14 +342,23 @@ static int Control (demux_t *demux, int i_query, va_list args)
         {
             int64_t *v = va_arg (args, int64_t *);
             *v = 0;
-            return 0;
+            return VLC_SUCCESS;
         }
 
         case DEMUX_GET_PTS_DELAY:
         {
             int64_t *v = va_arg (args, int64_t *);
-            *v = p_sys->caching;
-            return 0;
+            *v = p_sys->caching * 1000;
+            return VLC_SUCCESS;
+        }
+
+        case DEMUX_CAN_PAUSE:
+        case DEMUX_CAN_SEEK:
+        case DEMUX_CAN_CONTROL_PACE:
+        {
+            bool *v = (bool*)va_arg( args, bool * );
+            *v = false;
+            return VLC_SUCCESS;
         }
     }
 
@@ -453,8 +462,7 @@ static void codec_decode (demux_t *demux, void *data, block_t *block)
     if (data)
     {
         block->i_dts = 0; /* RTP does not specify this */
-        es_out_Control (demux->out, ES_OUT_SET_PCR,
-                        block->i_pts - demux->p_sys->caching * 1000);
+        es_out_Control (demux->out, ES_OUT_SET_PCR, block->i_pts );
         es_out_Send (demux->out, (es_out_id_t *)data, block);
     }
     else