int64_t i_pts;
float i_npt;
+ bool b_selected;
+
} live_track_t;
struct timeout_thread_t
MediaSubsessionIterator *iter = NULL;
MediaSubsession *sub = NULL;
- bool b_rtsp_tcp = false;
+ bool b_rtsp_tcp;
int i_client_port;
int i_return = VLC_SUCCESS;
unsigned int i_buffer = 0;
p_sys->env->getResultMsg() );
continue;
}
+ else
+ {
+ var_SetBool( p_demux, "rtsp-tcp", true );
+ b_rtsp_tcp = true;
+ }
}
}
tk->b_rtcp_sync = false;
tk->i_pts = VLC_TS_INVALID;
tk->i_npt = 0.;
+ tk->b_selected = true;
tk->i_buffer = 65536;
tk->p_buffer = (uint8_t *)malloc( 65536 );
if( !tk->p_buffer )
{
live_track_t *tk = p_sys->track[i];
+ if( tk->p_es )
+ {
+ bool b;
+ es_out_Control( p_demux->out, ES_OUT_GET_ES_STATE, tk->p_es, &b );
+ if( !b && tk->b_selected )
+ {
+ tk->b_selected = false;
+ p_sys->rtsp->sendTeardownCommand( *tk->sub, NULL );
+ }
+ else if( b && !tk->b_selected)
+ {
+ bool b_rtsp_tcp = var_GetBool( p_demux, "rtsp-tcp" ) ||
+ var_GetBool( p_demux, "rtsp-http" );
+ p_sys->rtsp->sendSetupCommand( *tk->sub, default_live555_callback, False,
+ toBool( b_rtsp_tcp ),
+ toBool( p_sys->b_force_mcast && !b_rtsp_tcp ) );
+ if( !wait_Live555_response( p_demux ) )
+ {
+ msg_Err( p_demux, "SETUP of'%s/%s' failed %s",
+ tk->sub->mediumName(), tk->sub->codecName(),
+ p_sys->env->getResultMsg() );
+ }
+ else
+ {
+ p_sys->rtsp->sendPlayCommand( *tk->sub, default_live555_callback, -1, -1, p_sys->ms->scale() );
+ if( !wait_Live555_response(p_demux) )
+ {
+ msg_Err( p_demux, "RTSP PLAY failed %s", p_sys->env->getResultMsg() );
+ p_sys->rtsp->sendTeardownCommand( *tk->sub, NULL );
+ }
+ else
+ tk->b_selected = true;
+ }
+ if( !tk->b_selected )
+ es_out_Control( p_demux->out, ES_OUT_SET_ES_STATE, tk->p_es, false );
+ }
+ }
+
if( tk->b_asf || tk->b_muxed )
b_send_pcr = false;
#if 0
case DEMUX_GET_PTS_DELAY:
pi64 = (int64_t*)va_arg( args, int64_t * );
*pi64 = INT64_C(1000)
- * var_GetInteger( p_demux, "network-caching" );
+ * var_InheritInteger( p_demux, "network-caching" );
return VLC_SUCCESS;
default:
live_track_t *tk = (live_track_t*)p_private;
demux_t *p_demux = tk->p_demux;
demux_sys_t *p_sys = p_demux->p_sys;
-
- msg_Dbg( p_demux, "StreamClose" );
-
+ tk->b_selected = false;
p_sys->event_rtsp = 0xff;
p_sys->event_data = 0xff;
- p_sys->b_error = true;
+
+ es_out_Control( p_demux->out, ES_OUT_SET_ES_STATE, tk->p_es, false );
+
+ int nb_tracks = 0;
+ for( int i = 0; i < p_sys->i_track; i++ )
+ {
+ if( p_sys->track[i]->b_selected )
+ nb_tracks++;
+ }
+ msg_Dbg( p_demux, "RTSP track Close, %d track remaining", nb_tracks );
+ if( !nb_tracks )
+ p_sys->b_error = true;
}