[vlc-devel] commit: Allow use of inputs without DEMUX_GET/SET_*TIME in input-slave. ( Antoine Cellerier )

git version control git at videolan.org
Fri Sep 12 00:04:20 CEST 2008


vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Fri Sep 12 00:06:15 2008 +0200| [60106b7432e0f6b61689486ba1fadf7c03db5f49] | committer: Antoine Cellerier 

Allow use of inputs without DEMUX_GET/SET_*TIME in input-slave.

This is commit is necessary to split the audio and video capture accesses.
Example use with current git master to record screen and webcam:
./vlc screen:// --screen-fps 25 --screen-width 100 --screen-height 100 -I dummy --screen-follow-mouse --input-slave v4l2://:audio-method=0 -vv --sout '#transcode{vcodec=mp2v,vb=1024}:std{access=file,mux=ts,dst=/tmp/a.ts}' --run-time 10

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

 src/input/input.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index 13e1e31..60806bf 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1951,7 +1951,7 @@ static bool Control( input_thread_t *p_input, int i_type,
                         break;
                     }
                     if( demux_Control( slave->p_demux,
-                                        DEMUX_SET_TIME, i_time ) )
+                                       DEMUX_SET_TIME, i_time ) )
                     {
                         msg_Err( p_input, "seek failed for new slave" );
                         InputSourceClean( slave );
@@ -2515,11 +2515,12 @@ static void SlaveDemux( input_thread_t *p_input )
 {
     int64_t i_time;
     int i;
+    bool b_set_time = true;
 
     if( demux_Control( p_input->p->input.p_demux, DEMUX_GET_TIME, &i_time ) )
     {
-        msg_Err( p_input, "demux doesn't like DEMUX_GET_TIME" );
-        return;
+        /* msg_Err( p_input, "demux doesn't like DEMUX_GET_TIME" ); */
+        b_set_time = false;
     }
 
     for( i = 0; i < p_input->p->i_slave; i++ )
@@ -2530,7 +2531,7 @@ static void SlaveDemux( input_thread_t *p_input )
         if( in->b_eof )
             continue;
 
-        if( demux_Control( in->p_demux, DEMUX_SET_NEXT_DEMUX_TIME, i_time ) )
+        if( b_set_time && demux_Control( in->p_demux, DEMUX_SET_NEXT_DEMUX_TIME, i_time ) )
         {
             for( ;; )
             {




More information about the vlc-devel mailing list