Commit 13543580 authored by Sam Hocevar's avatar Sam Hocevar

* ./src/playlist/playlist.c: don't run the playlist by default.

  * ./src/libvlc.c: if items are specified in the commandline, run the playlist.
  * ./src/vlc.c: don't rely on internal vlc types (mtime_t).
parent 04b80451
......@@ -2,7 +2,7 @@
* vlc.h: global header for vlc
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc.h,v 1.13 2002/08/26 23:36:20 sam Exp $
* $Id: vlc.h,v 1.14 2002/09/29 18:19:53 sam Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -45,6 +45,7 @@ typedef int vlc_status_t;
#define VLC_EMODULE -2 /* Module not found */
#define VLC_ESTATUS -3 /* Invalid status */
#define VLC_ETHREAD -4 /* Could not spawn thread */
#define VLC_EOBJECT -5 /* Object not found */
#define VLC_EEXIT -255 /* Program exited */
#define VLC_EGENERIC -666 /* Generic error */
......@@ -105,7 +106,6 @@ vlc_status_t vlc_status ( void );
vlc_error_t vlc_create ( void );
vlc_error_t vlc_init ( int, char *[] );
vlc_error_t vlc_run ( void );
vlc_error_t vlc_die ( void );
vlc_error_t vlc_destroy ( void );
......@@ -113,6 +113,11 @@ vlc_error_t vlc_set ( const char *, const char * );
vlc_error_t vlc_add_intf ( const char *, vlc_bool_t );
vlc_error_t vlc_add_target ( const char *, int, int );
vlc_error_t vlc_play ( );
vlc_error_t vlc_pause ( );
vlc_error_t vlc_stop ( void );
vlc_error_t vlc_fullscreen ( );
/*****************************************************************************
* Exported libvlc reentrant API
*****************************************************************************/
......@@ -120,7 +125,6 @@ vlc_status_t vlc_status_r ( vlc_t * );
vlc_t * vlc_create_r ( void );
vlc_error_t vlc_init_r ( vlc_t *, int, char *[] );
vlc_error_t vlc_run_r ( vlc_t * );
vlc_error_t vlc_die_r ( vlc_t * );
vlc_error_t vlc_destroy_r ( vlc_t * );
......@@ -128,6 +132,11 @@ vlc_error_t vlc_set_r ( vlc_t *, const char *, const char * );
vlc_error_t vlc_add_intf_r ( vlc_t *, const char *, vlc_bool_t );
vlc_error_t vlc_add_target_r ( vlc_t *, const char *, int, int );
vlc_error_t vlc_play_r ( vlc_t * );
vlc_error_t vlc_pause_r ( vlc_t * );
vlc_error_t vlc_stop_r ( vlc_t * );
vlc_error_t vlc_fullscreen_r ( vlc_t * );
# ifdef __cplusplus
}
# endif
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* configuration.c management of the modules configuration
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: configuration.c,v 1.38 2002/08/20 18:25:42 sam Exp $
* $Id: configuration.c,v 1.39 2002/09/29 18:19:53 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -37,7 +37,7 @@
# include <getopt.h> /* getopt() */
# endif
#else
# include "GNUgetopt/getopt.h"
# include "extras/GNUgetopt/getopt.h"
#endif
#if defined(HAVE_GETPWUID)
......
......@@ -2,7 +2,7 @@
* playlist.c : Playlist management functions
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: playlist.c,v 1.13 2002/08/29 23:53:22 massiot Exp $
* $Id: playlist.c,v 1.14 2002/09/29 18:19:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -62,7 +62,7 @@ playlist_t * __playlist_Create ( vlc_object_t *p_parent )
}
p_playlist->p_input = NULL;
p_playlist->i_status = PLAYLIST_RUNNING;
p_playlist->i_status = PLAYLIST_STOPPED;
p_playlist->i_index = -1;
p_playlist->i_size = 0;
p_playlist->pp_items = NULL;
......
......@@ -2,7 +2,7 @@
* vlc.c: the vlc player
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: vlc.c,v 1.10 2002/08/20 18:08:51 sam Exp $
* $Id: vlc.c,v 1.11 2002/09/29 18:19:53 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -28,9 +28,12 @@
#include <stdio.h> /* fprintf() */
#include <stdlib.h> /* putenv(), strtol(), */
#include <signal.h> /* SIGHUP, SIGINT, SIGKILL */
#include <time.h> /* time() */
#include <vlc/vlc.h>
#include "config.h"
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
......@@ -87,7 +90,7 @@ int main( int i_argc, char *ppsz_argv[] )
}
/* Run libvlc, in non-blocking mode */
err = vlc_run();
err = vlc_play();
/* Add background interfaces */
#if 0
......@@ -103,7 +106,10 @@ int main( int i_argc, char *ppsz_argv[] )
/* Add a blocking interface and keep the return value */
err = vlc_add_intf( NULL, VLC_TRUE );
/* Finish the threads and destroy the libvlc structure */
/* Finish the threads */
vlc_stop();
/* Destroy the libvlc structure */
vlc_destroy();
return err;
......@@ -118,7 +124,7 @@ int main( int i_argc, char *ppsz_argv[] )
*****************************************************************************/
static void SigHandler( int i_signal )
{
static mtime_t abort_time = 0;
static time_t abort_time = 0;
static volatile vlc_bool_t b_die = VLC_FALSE;
/* Once a signal has been trapped, the termination sequence will be
......@@ -128,7 +134,7 @@ static void SigHandler( int i_signal )
if( !b_die )
{
b_die = VLC_TRUE;
abort_time = mdate();
abort_time = time( NULL );
fprintf( stderr, "signal %d received, terminating vlc - do it "
"again in case it gets stuck\n", i_signal );
......@@ -136,9 +142,9 @@ static void SigHandler( int i_signal )
/* Acknowledge the signal received */
vlc_die();
}
else if( mdate() > abort_time + 1000000 )
else if( time( NULL ) > abort_time + 2 )
{
/* If user asks again 1 second later, die badly */
/* If user asks again 1 or 2 seconds later, die badly */
signal( SIGINT, SIG_DFL );
signal( SIGHUP, SIG_DFL );
signal( SIGQUIT, SIG_DFL );
......@@ -147,7 +153,7 @@ static void SigHandler( int i_signal )
fprintf( stderr, "user insisted too much, dying badly\n" );
exit( 1 );
abort();
}
}
#endif
......
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