[vlc-devel] [PATCH 2/3] stream_Demux: handle slave demuxes

Francois Cartegnie fcvlcdev at free.fr
Mon Sep 14 14:11:19 CEST 2015


Passive demux requiring SET_NEXT_DEMUX_TIME controls
are never demuxed through stream_Demux()
---
 src/input/stream_demux.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/input/stream_demux.c b/src/input/stream_demux.c
index e6a104c..a7629b4 100644
--- a/src/input/stream_demux.c
+++ b/src/input/stream_demux.c
@@ -54,6 +54,7 @@ struct stream_sys_t
         int64_t length;
         int64_t time;
     } stats;
+    mtime_t i_next_demux_time;
 };
 
 static ssize_t DStreamRead( stream_t *, void *p_read, size_t i_read );
@@ -88,6 +89,7 @@ stream_t *stream_DemuxNew( demux_t *p_demux, const char *psz_demux, es_out_t *ou
     p_sys->stats.position = 0.;
     p_sys->stats.length = 0;
     p_sys->stats.time = 0;
+    p_sys->i_next_demux_time = VLC_TS_0 + CLOCK_FREQ / 4;
 
     /* decoder fifo */
     if( ( p_sys->p_fifo = block_FifoNew() ) == NULL )
@@ -289,7 +291,13 @@ static void* DStreamThread( void *obj )
         }
 
         if( demux_Demux( p_demux ) <= 0 )
+        {
             break;
+        }
+        vlc_mutex_lock( &p_sys->lock );
+        demux_Control( p_demux, DEMUX_SET_NEXT_DEMUX_TIME, p_sys->i_next_demux_time );
+        p_sys->i_next_demux_time += CLOCK_FREQ / 4;
+        vlc_mutex_unlock( &p_sys->lock );
     }
 
     /* Explicit kludge: the stream is destroyed by the owner of the
-- 
2.4.3



More information about the vlc-devel mailing list