* This header provides portable declarations for mutexes & conditions
*****************************************************************************
* Copyright (C) 1999, 2002 VideoLAN
- * $Id: vlc_threads.h,v 1.36 2003/11/22 00:41:07 titer Exp $
+ * $Id: vlc_threads.h,v 1.37 2004/03/01 12:50:39 gbazin Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
/* Define different priorities for WinNT/2K/XP and Win9x/Me */
# define VLC_THREAD_PRIORITY_LOW 0
# define VLC_THREAD_PRIORITY_INPUT \
- (IS_WINNT ? THREAD_PRIORITY_TIME_CRITICAL : 0)
+ (IS_WINNT ? THREAD_PRIORITY_ABOVE_NORMAL : 0)
# define VLC_THREAD_PRIORITY_AUDIO \
(IS_WINNT ? THREAD_PRIORITY_HIGHEST : 0)
# define VLC_THREAD_PRIORITY_VIDEO \
* file.c: file input (file: access plug-in)
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: file.c,v 1.22 2004/01/25 17:31:22 gbazin Exp $
+ * $Id: file.c,v 1.23 2004/03/01 12:50:39 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
#endif
_input_socket_t * p_access_data;
vlc_bool_t b_stdin, b_kfir = 0;
+ vlc_value_t val;
p_input->i_mtu = 0;
}
/* Update default_pts to a suitable value for file access */
- p_input->i_pts_delay = config_GetInt( p_input, "file-caching" ) * 1000;
+ var_Create( p_input, "file-caching", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
+ var_Get( p_input, "file-caching", &val );
+ p_input->i_pts_delay = val.i_int * 1000;
return VLC_SUCCESS;
}
* udp.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: udp.c,v 1.20 2004/02/20 17:13:42 massiot Exp $
+ * $Id: udp.c,v 1.21 2004/03/01 12:50:39 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
p_sys->i_mtu = socket_desc.i_mtu;
+#ifdef WIN32
+ if( vlc_thread_create( p_sys->p_thread, "sout write thread", ThreadWrite,
+ VLC_THREAD_PRIORITY_HIGHEST, VLC_FALSE ) )
+#else
if( vlc_thread_create( p_sys->p_thread, "sout write thread", ThreadWrite,
VLC_THREAD_PRIORITY_OUTPUT, VLC_FALSE ) )
+#endif
{
msg_Err( p_access->p_sout, "cannot spawn sout access thread" );
vlc_object_destroy( p_sys->p_thread );
sout_access_thread_t *p_thread = (sout_access_thread_t*)p_this;
sout_instance_t *p_sout = p_thread->p_sout;
mtime_t i_date_last = -1;
+ int i_dropped_packets = 0;
while( ! p_thread->b_die )
{
{
if( i_date - i_date_last > 2000000 )
{
- msg_Dbg( p_thread, "mmh, hole > 2s -> drop" );
+ if( !i_dropped_packets )
+ msg_Dbg( p_thread, "mmh, hole > 2s -> drop" );
sout_BufferDelete( p_sout, p_pk );
i_date_last = i_date;
+ i_dropped_packets++;
continue;
}
else if( i_date - i_date_last < 0 )
{
- msg_Dbg( p_thread, "mmh, paquets in the past -> drop" );
+ if( !i_dropped_packets )
+ msg_Dbg( p_thread, "mmh, paquets in the past -> drop" );
sout_BufferDelete( p_sout, p_pk );
i_date_last = i_date;
+ i_dropped_packets++;
continue;
}
}
i_sent = mdate();
if ( i_sent > i_date + 100000 )
{
- msg_Dbg( p_thread, "late packet to send (" I64Fd ") -> drop",
- i_sent - i_date );
+ if( !i_dropped_packets )
+ msg_Dbg( p_thread, "late packet to send (" I64Fd ") -> drop",
+ i_sent - i_date );
sout_BufferDelete( p_sout, p_pk );
i_date_last = i_date;
+ i_dropped_packets++;
continue;
}
mwait( i_date );
send( p_thread->i_handle, p_pk->p_buffer, p_pk->i_size, 0 );
+ if( i_dropped_packets )
+ {
+ msg_Dbg( p_thread, "dropped %i packets", i_dropped_packets );
+ i_dropped_packets = 0;
+ }
+
+#if 0
i_sent = mdate();
if ( i_sent > i_date + 20000 )
{
msg_Dbg( p_thread, "packet has been sent too late (" I64Fd ")",
i_sent - i_date );
}
+#endif
+
sout_BufferDelete( p_sout, p_pk );
i_date_last = i_date;
}