* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_ext-intf.h,v 1.81 2002/12/12 15:10:58 gbazin Exp $
+ * $Id: input_ext-intf.h,v 1.82 2002/12/31 01:54:35 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
disc or network */
vlc_bool_t b_pace_control; /* can we read when we want ? */
vlc_bool_t b_seekable; /* can we do lseek() ? */
+ vlc_bool_t b_connected; /* does read() == 0 imply EOF ? */
/* if (b_seekable) : */
unsigned int i_area_nb;
* Input thread configuration
*****************************************************************************/
-/* XXX?? */
+/* Used in ErrorThread */
#define INPUT_IDLE_SLEEP ((mtime_t)(0.100*CLOCK_FREQ))
+/* Time to wait in case of read error */
+#define INPUT_ERROR_SLEEP ((mtime_t)(0.10*CLOCK_FREQ))
+
/*
* General limitations
*/
* -udf.* to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: access.c,v 1.7 2002/12/30 23:45:21 massiot Exp $
+ * $Id: access.c,v 1.8 2002/12/31 01:54:35 massiot Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
p_input->stream.i_method = INPUT_METHOD_DVD;
p_input->stream.b_pace_control = 1;
p_input->stream.b_seekable = 1;
+ p_input->stream.b_connected = 1;
p_input->stream.p_selected_area->i_size = 0;
p_input->stream.p_selected_area->i_tell = 0;
* access.c: access capabilities for dvdplay plugin.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: access.c,v 1.8 2002/12/13 01:50:32 gbazin Exp $
+ * $Id: access.c,v 1.9 2002/12/31 01:54:35 massiot Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
p_input->stream.b_pace_control = 1;
/* seek is only allowed when we have size info */
p_input->stream.b_seekable = 0;
+ p_input->stream.b_connected = 1;
/* Initialize ES structures */
input_InitStream( p_input, sizeof( stream_ps_data_t ) );
* It depends on: libdvdread for ifo files and block reading.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: input.c,v 1.10 2002/12/30 23:45:21 massiot Exp $
+ * $Id: input.c,v 1.11 2002/12/31 01:54:35 massiot Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
/* If we are here we can control the pace... */
p_input->stream.b_pace_control = 1;
p_input->stream.b_seekable = 1;
+ p_input->stream.b_connected = 1;
p_input->stream.p_selected_area->i_size = 0;
p_input->stream.p_selected_area->i_tell = 0;
* file.c: file input (file: access plug-in)
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: file.c,v 1.6 2002/12/12 15:10:58 gbazin Exp $
+ * $Id: file.c,v 1.7 2002/12/31 01:54:35 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
vlc_mutex_lock( &p_input->stream.stream_lock );
+ p_input->stream.b_connected = 1;
if( *p_input->psz_access && !strncmp( p_input->psz_access, "stream", 7 ) )
{
/* stream:%s */
GetFileSize( (HANDLE)p_access_data->i_handle, NULL );
#else
p_access_data->i_handle = open( psz_name,
- /*O_NONBLOCK | O_LARGEFILE*/ 0 );
+ O_NONBLOCK /*| O_LARGEFILE*/ );
if( p_access_data->i_handle == -1 )
{
# ifdef HAVE_ERRNO_H
#endif
}
+ if ( p_input->stream.b_seekable
+ && !p_input->stream.p_selected_area->i_size )
+ {
+ msg_Err( p_input, "file %s is empty, aborting", psz_name );
+ free( p_access_data );
+ return VLC_EGENERIC;
+ }
+
/* Update default_pts to a suitable value for file access */
p_input->i_pts_delay = config_GetInt( p_input, "file-caching" ) * 1000;
#else
i_ret = read( p_access_data->i_handle, p_buffer, i_len );
#endif
-
+
if( i_ret < 0 )
{
# ifdef HAVE_ERRNO_H
- msg_Err( p_input, "read failed (%s)", strerror(errno) );
+ if ( errno != EINTR && errno != EAGAIN )
+ msg_Err( p_input, "read failed (%s)", strerror(errno) );
# else
msg_Err( p_input, "read failed" );
# endif
+
+ /* Delay a bit to avoid consuming all the CPU. This is particularly
+ * useful when reading from an unconnected FIFO. */
+ msleep( INPUT_ERROR_SLEEP );
}
return i_ret;
* ftp.c:
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: ftp.c,v 1.4 2002/12/25 02:23:36 massiot Exp $
+ * $Id: ftp.c,v 1.5 2002/12/31 01:54:35 massiot Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
p_input->stream.b_pace_control = 1;
p_input->stream.p_selected_area->i_tell = 0;
p_input->stream.b_seekable = 1;
+ p_input->stream.b_connected = 1;
p_input->stream.p_selected_area->i_size = p_access->i_filesize;
p_input->stream.i_method = INPUT_METHOD_NETWORK;
vlc_mutex_unlock( &p_input->stream.stream_lock );
* http.c: HTTP access plug-in
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: http.c,v 1.19 2002/12/23 15:39:07 massiot Exp $
+ * $Id: http.c,v 1.20 2002/12/31 01:54:35 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.b_pace_control = VLC_TRUE;
p_input->stream.b_seekable = VLC_TRUE;
+ p_input->stream.b_connected = VLC_TRUE;
p_input->stream.p_selected_area->i_tell = 0;
p_input->stream.p_selected_area->i_size = 0;
p_input->stream.i_method = INPUT_METHOD_NETWORK;
* mms.c: MMS access plug-in
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: mms.c,v 1.15 2002/12/30 08:56:19 massiot Exp $
+ * $Id: mms.c,v 1.16 2002/12/31 01:54:35 massiot Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
/* *** finished to set some variable *** */
vlc_mutex_lock( &p_input->stream.stream_lock );
+ p_input->stream.b_pace_control = 0;
if( p_access->i_proto == MMS_PROTO_UDP )
{
- p_input->stream.b_pace_control = 0;
+ p_input->stream.b_connected = 0;
}
else
{
- p_input->stream.b_pace_control = 1;
+ p_input->stream.b_connected = 1;
}
p_input->stream.p_selected_area->i_tell = 0;
if( p_access->i_packet_count <= 0 )
p_input->stream.b_pace_control = 1;
p_input->stream.b_seekable = 0;
+ p_input->stream.b_connected = 0;
p_input->stream.p_selected_area->i_tell = 0;
vlc_mutex_unlock( &p_input->stream.stream_lock );
* udp.c: raw UDP & RTP access plug-in
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: udp.c,v 1.9 2002/12/30 11:49:32 massiot Exp $
+ * $Id: udp.c,v 1.10 2002/12/31 01:54:35 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Tristan Leteurtre <tooney@via.ecp.fr>
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.b_pace_control = 0;
p_input->stream.b_seekable = 0;
+ p_input->stream.b_connected = 0;
p_input->stream.p_selected_area->i_tell = 0;
p_input->stream.i_method = INPUT_METHOD_NETWORK;
vlc_mutex_unlock( &p_input->stream.stream_lock );
* v4l.c : Video4Linux input module for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: v4l.c,v 1.1 2002/08/08 00:35:10 sam Exp $
+ * $Id: v4l.c,v 1.2 2002/12/31 01:54:36 massiot Exp $
*
* Author: Samuel Hocevar <sam@zoy.org>
*
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.b_pace_control = 0;
p_input->stream.b_seekable = 0;
+ p_input->stream.b_connected = 0;
p_input->stream.p_selected_area->i_size = 0;
p_input->stream.p_selected_area->i_tell = 0;
p_input->stream.i_method = INPUT_METHOD_FILE;
* vcd.c : VCD input module for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: vcd.c,v 1.12 2002/12/06 16:34:04 sam Exp $
+ * $Id: vcd.c,v 1.13 2002/12/31 01:54:36 massiot Exp $
*
* Author: Johan Bilien <jobi@via.ecp.fr>
*
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.b_pace_control = 1;
-
p_input->stream.b_seekable = 1;
+ p_input->stream.b_connected = 1;
p_input->stream.p_selected_area->i_size = 0;
p_input->stream.p_selected_area->i_tell = 0;
* vpar_synchro.c : frame dropping routines
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: synchro.c,v 1.4 2002/11/08 10:26:53 gbazin Exp $
+ * $Id: synchro.c,v 1.5 2002/12/31 01:54:36 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
if( p_vpar->synchro.i_type == VPAR_SYNCHRO_DEFAULT )
{
+#if 0
msg_Dbg( p_vpar->p_fifo, "I("I64Fd") P("I64Fd")[%d] B("I64Fd")"
"[%d] YUV("I64Fd") : trashed %d:%d/%d",
p_vpar->synchro.p_tau[I_CODING_TYPE],
p_vpar->synchro.i_pic );
p_vpar->synchro.i_trashed_pic = p_vpar->synchro.i_not_chosen_pic
= p_vpar->synchro.i_pic = 0;
+#else
+ if ( p_vpar->synchro.i_pic >= 100 )
+ {
+ msg_Dbg( p_vpar->p_fifo, "decoded %d/%d pictures",
+ p_vpar->synchro.i_pic
+ - p_vpar->synchro.i_trashed_pic
+ - p_vpar->synchro.i_not_chosen_pic,
+ p_vpar->synchro.i_pic );
+ p_vpar->synchro.i_trashed_pic = p_vpar->synchro.i_not_chosen_pic
+ = p_vpar->synchro.i_pic = 0;
+ }
+#endif
}
break;
* decoders.
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: input.c,v 1.220 2002/12/18 14:17:11 sam Exp $
+ * $Id: input.c,v 1.221 2002/12/31 01:54:36 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
/* Read and demultiplex some data. */
i_count = p_input->pf_demux( p_input );
- if( i_count == 0 && p_input->stream.b_seekable )
+ if( i_count == 0 && p_input->stream.b_connected )
{
/* End of file - we do not set b_die because only the
* playlist is allowed to do so. */
p_input->p_demux = module_Need( p_input, "demux",
p_input->psz_demux );
- if( p_input->p_demux== NULL )
+ if( p_input->p_demux == NULL )
{
msg_Err( p_input, "no suitable demux module for `%s/%s://%s'",
p_input->psz_access, p_input->psz_demux, p_input->psz_name );
* darwin_specific.m: Darwin specific features
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: darwin_specific.m,v 1.1 2002/12/30 08:56:19 massiot Exp $
+ * $Id: darwin_specific.m,v 1.2 2002/12/31 01:54:36 massiot Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Christophe Massiot <massiot@via.ecp.fr>
/* Check if $LANG is set. */
if ( (p_char = getenv("LANG")) == NULL )
{
+ NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
/* Retrieve user's preferences. */
NSUserDefaults * p_defs =
[[NSUserDefaults standardUserDefaults] autorelease];
break;
}
}
+ /* FIXME : why does it segfault ??? */
+ //[o_pool release];
}
}