HEAD
+ * ./src/playlist/playlist.c, src/input/input.c: added safety checks to
+ prevent crashes on next file.
* ./src/misc/objects.c: commented all functions.
* ./src/misc/objects.c: implemented vlc_object_find( , , FIND_ANYWHERE).
* ./src/misc/objects.c: renamed vlc_object_unlink to vlc_object_detach.
* ALL: the first libvlc commit.
0.4.1
+Not released yet
+ * ./plugins/gtk/gtk_display.c, ./plugins/win32/mainframe.cpp: we deactivate
+ popup menus when no stream is being played, even in network mode.
+ * ./src/input/mpeg_system.c: removed unnecessarily verbose message.
* ./src/video_output/video_output.c: fixed the "picture has invalid status"
bug which might have been the cause of crashes.
* ./plugins/filter/crop.c: attempt at an automatic border cropping filter,
* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_ext-intf.h,v 1.68 2002/06/01 18:04:48 sam Exp $
+ * $Id: input_ext-intf.h,v 1.69 2002/06/02 11:59:46 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
{
VLC_COMMON_MEMBERS
- /* Thread properties and locks */
+ /* Thread properties */
vlc_bool_t b_eof;
- int i_status; /* status flag */
/* Access module */
module_t * p_access_module;
#define input_CreateThread(a,b,c) __input_CreateThread(CAST_TO_VLC_OBJECT(a),b,c)
input_thread_t * __input_CreateThread ( vlc_object_t *,
playlist_item_t *, int * );
-void input_StopThread ( input_thread_t *, int *pi_status );
+void input_StopThread ( input_thread_t * );
void input_DestroyThread ( input_thread_t * );
#define input_SetStatus(a,b) __input_SetStatus(CAST_TO_VLC_OBJECT(a),b)
* gtk_display.c: Gtk+ tools for main interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: gtk_display.c,v 1.24 2002/06/02 09:03:54 sam Exp $
+ * $Id: gtk_display.c,v 1.25 2002/06/02 11:59:46 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
GTK_OBJECT( p_intf->p_sys->p_window ), "label_status" );
gtk_label_set_text( GTK_LABEL( p_label ), "" );
gtk_widget_show( GTK_WIDGET( p_file_box ) );
-
- /* unsensitize menus */
- gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_program"),
- FALSE );
- gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_title"), FALSE );
- gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_chapter"),
- FALSE );
- gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_audio"), FALSE );
- gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_subpictures"),
- FALSE );
- gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_navigation"),
- FALSE );
- gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_audio"), FALSE );
- gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_subpictures"),
- FALSE );
}
+
+ /* unsensitize menus */
+ gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_program"),
+ FALSE );
+ gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_title"), FALSE );
+ gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_chapter"),
+ FALSE );
+ gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_audio"), FALSE );
+ gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_subpictures"),
+ FALSE );
+ gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_navigation"),
+ FALSE );
+ gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_audio"), FALSE );
+ gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_subpictures"),
+ FALSE );
}
/* set control items */
/* add space between tolbar and statusbar when\r
* nothing is displayed; isn't it nicer ? :) */ \r
i_Height += 17;\r
-\r
- /* unsensitize menus */\r
- MenuProgram->Enabled = false;\r
- MenuTitle->Enabled = false;\r
- MenuChapter->Enabled = false;\r
- MenuAudio->Enabled = false;\r
- MenuSubtitles->Enabled = false;\r
- PopupNavigation->Enabled = false;\r
- PopupAudio->Enabled = false;\r
- PopupSubtitles->Enabled = false;\r
}\r
+\r
+ /* unsensitize menus */\r
+ MenuProgram->Enabled = false;\r
+ MenuTitle->Enabled = false;\r
+ MenuChapter->Enabled = false;\r
+ MenuAudio->Enabled = false;\r
+ MenuSubtitles->Enabled = false;\r
+ PopupNavigation->Enabled = false;\r
+ PopupAudio->Enabled = false;\r
+ PopupSubtitles->Enabled = false;\r
}\r
\r
/* resize main window */\r
* decoders.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: input.c,v 1.199 2002/06/01 18:04:49 sam Exp $
+ * $Id: input.c,v 1.200 2002/06/02 11:59:46 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
static int InitThread ( input_thread_t *p_input );
static void ErrorThread ( input_thread_t *p_input );
static void CloseThread ( input_thread_t *p_input );
-static void DestroyThread ( input_thread_t *p_input );
static void EndThread ( input_thread_t *p_input );
/*****************************************************************************
/* Set target */
p_input->psz_source = strdup( p_item->psz_name );
- /* Set status */
- p_input->i_status = THREAD_CREATE;
-
/* Demux */
p_input->p_demux_module = NULL;
p_input->pf_init = NULL;
vlc_object_attach( p_input, p_parent );
- /* Create thread. */
+ /* Create thread and wait for its readiness. */
if( vlc_thread_create( p_input, "input", RunThread, 1 ) )
{
msg_Err( p_input, "cannot create input thread (%s)", strerror(errno) );
return NULL;
}
-#if 0
- /* If status is NULL, wait until the thread is created */
- if( pi_status == NULL )
- {
- do
- {
- msleep( THREAD_SLEEP );
- } while( (i_status != THREAD_READY) && (i_status != THREAD_ERROR)
- && (i_status != THREAD_FATAL) );
- }
-#endif
-
return p_input;
}
*****************************************************************************
* This function should not return until the thread is effectively cancelled.
*****************************************************************************/
-void input_StopThread( input_thread_t *p_input, int *pi_status )
+void input_StopThread( input_thread_t *p_input )
{
/* Make the thread exit from a possible vlc_cond_wait() */
vlc_mutex_lock( &p_input->stream.stream_lock );
vlc_cond_signal( &p_input->stream.stream_wait );
vlc_mutex_unlock( &p_input->stream.stream_lock );
-
- /* If status is NULL, wait until thread has been destroyed */
-#if 0
- if( pi_status == NULL )
- {
- do
- {
- msleep( THREAD_SLEEP );
- } while ( (i_status != THREAD_OVER) && (i_status != THREAD_ERROR)
- && (i_status != THREAD_FATAL) );
- }
-#endif
}
/*****************************************************************************
vlc_mutex_destroy( &p_input->stream.control.control_lock );
vlc_cond_destroy( &p_input->stream.stream_wait );
vlc_mutex_destroy( &p_input->stream.stream_lock );
-
- /* Free input structure */
- free( p_input );
}
/*****************************************************************************
if( InitThread( p_input ) )
{
/* If we failed, wait before we are killed, and exit */
- p_input->i_status = THREAD_ERROR;
p_input->b_error = 1;
vlc_thread_ready( p_input );
ErrorThread( p_input );
- DestroyThread( p_input );
return 0;
}
vlc_thread_ready( p_input );
- p_input->i_status = THREAD_READY;
-
/* initialization is complete */
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.b_changed = 1;
EndThread( p_input );
- DestroyThread( p_input );
-
return 0;
}
input_DumpStream( p_input );
- /* Store status */
- p_input->i_status = THREAD_END;
+ /* Tell we're dead */
+ p_input->b_dead = 1;
/* Free all ES and destroy all decoder threads */
input_EndStream( p_input );
free( p_input->psz_source );
}
-/*****************************************************************************
- * DestroyThread: destroy the input thread
- *****************************************************************************/
-static void DestroyThread( input_thread_t * p_input )
-{
- /* Update status */
- p_input->i_status = THREAD_OVER;
-}
-
* mpeg_system.c: TS, PS and PES management
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: mpeg_system.c,v 1.98 2002/06/01 12:32:01 sam Exp $
+ * $Id: mpeg_system.c,v 1.99 2002/06/02 11:59:46 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
* draft. As there is nothing interesting in this packet
* (except PCR that have already been handled), we can trash
* the packet. */
- msg_Warn( p_input,
- "packet without payload received by TS demux" );
b_trash = 1;
}
else if( i_dummy <= 0 )
* playlist.c : Playlist management functions
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: playlist.c,v 1.3 2002/06/02 09:03:54 sam Exp $
+ * $Id: playlist.c,v 1.4 2002/06/02 11:59:46 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* playlist_Command: do a playlist action
*****************************************************************************
- * Delete the item in the playlist with position i_pos.
+ *
*****************************************************************************/
void playlist_Command( playlist_t * p_playlist, int i_command, int i_arg )
{
/* If there is an input, check that it doesn't need to die. */
if( p_playlist->p_input )
{
- if( p_playlist->p_input->i_status == THREAD_OVER )
+ if( p_playlist->p_input->b_dead )
{
input_thread_t *p_input;
vlc_object_detach_all( p_input );
vlc_object_release( p_input );
input_DestroyThread( p_input );
+ vlc_object_destroy( p_input );
}
- else if( ( p_playlist->p_input->i_status == THREAD_READY
- || p_playlist->p_input->i_status == THREAD_ERROR )
- && ( p_playlist->p_input->b_error
- || p_playlist->p_input->b_eof ) )
+ else if( p_playlist->p_input->b_error
+ || p_playlist->p_input->b_eof )
{
- input_StopThread( p_playlist->p_input, NULL );
+ input_StopThread( p_playlist->p_input );
}
}
else if( p_playlist->i_status != PLAYLIST_STOPPED )
/* If there is an input, kill it */
while( p_playlist->p_input )
{
- if( p_playlist->p_input->i_status == THREAD_OVER )
+ if( p_playlist->p_input->b_dead )
{
input_thread_t *p_input;
vlc_object_detach_all( p_input );
vlc_object_release( p_input );
input_DestroyThread( p_input );
+ vlc_object_destroy( p_input );
}
- else if( ( p_playlist->p_input->i_status == THREAD_READY
- || p_playlist->p_input->i_status == THREAD_ERROR )
- && ( p_playlist->p_input->b_error
- || p_playlist->p_input->b_eof ) )
+ else if( p_playlist->p_input->b_error || p_playlist->p_input->b_eof )
{
- input_StopThread( p_playlist->p_input, NULL );
+ input_StopThread( p_playlist->p_input );
}
else
{