Commit 60106b74 authored by Antoine Cellerier's avatar 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
parent 7ad836c7
...@@ -1951,7 +1951,7 @@ static bool Control( input_thread_t *p_input, int i_type, ...@@ -1951,7 +1951,7 @@ static bool Control( input_thread_t *p_input, int i_type,
break; break;
} }
if( demux_Control( slave->p_demux, 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" ); msg_Err( p_input, "seek failed for new slave" );
InputSourceClean( slave ); InputSourceClean( slave );
...@@ -2515,11 +2515,12 @@ static void SlaveDemux( input_thread_t *p_input ) ...@@ -2515,11 +2515,12 @@ static void SlaveDemux( input_thread_t *p_input )
{ {
int64_t i_time; int64_t i_time;
int i; int i;
bool b_set_time = true;
if( demux_Control( p_input->p->input.p_demux, DEMUX_GET_TIME, &i_time ) ) 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" ); /* msg_Err( p_input, "demux doesn't like DEMUX_GET_TIME" ); */
return; b_set_time = false;
} }
for( i = 0; i < p_input->p->i_slave; i++ ) for( i = 0; i < p_input->p->i_slave; i++ )
...@@ -2530,7 +2531,7 @@ static void SlaveDemux( input_thread_t *p_input ) ...@@ -2530,7 +2531,7 @@ static void SlaveDemux( input_thread_t *p_input )
if( in->b_eof ) if( in->b_eof )
continue; 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( ;; ) for( ;; )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment