Commit 74ea8fa5 authored by Sam Hocevar's avatar Sam Hocevar

* ./plugins/dummy/input_dummy.c: dummy targets such as vlc:nop, vlc:loop

    and vlc:quit work again.
  * ./src/playlist/playlist.c: when a new target is added, for instance through     the "File" menu, it is automatically played.
parent 3712520f
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
0.5.0 0.5.0
Not released yet Not released yet
* ./plugins/dummy/input_dummy.c: dummy targets such as vlc:nop, vlc:loop
and vlc:quit work again.
* ./src/playlist/playlist.c: when a new target is added, for instance through
the "File" menu, it is automatically played.
* ./include/vlc_objects.h: pointers are set to NULL after a call to * ./include/vlc_objects.h: pointers are set to NULL after a call to
vlc_object_destroy. vlc_object_destroy.
* ./po/pl.po: updated polish translation, thanks to Arkadiusz Lipiec * ./po/pl.po: updated polish translation, thanks to Arkadiusz Lipiec
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_dummy.c: dummy input plugin, to manage "vlc:***" special options * input_dummy.c: dummy input plugin, to manage "vlc:***" special options
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: input_dummy.c,v 1.18 2002/06/01 12:31:58 sam Exp $ * $Id: input_dummy.c,v 1.19 2002/06/07 16:06:09 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -94,7 +94,7 @@ static int DummyOpen( input_thread_t * p_input ) ...@@ -94,7 +94,7 @@ static int DummyOpen( input_thread_t * p_input )
/* Force dummy demux plug-in */ /* Force dummy demux plug-in */
p_input->psz_demux = "vlc"; p_input->psz_demux = "vlc";
return( 0 ); return 0;
} }
/***************************************************************************** /*****************************************************************************
...@@ -120,7 +120,7 @@ static int DummyInit( input_thread_t *p_input ) ...@@ -120,7 +120,7 @@ static int DummyInit( input_thread_t *p_input )
if( p_method == NULL ) if( p_method == NULL )
{ {
msg_Err( p_input, "out of memory" ); msg_Err( p_input, "out of memory" );
return( -1 ); return -1;
} }
p_input->p_demux_data = p_method; p_input->p_demux_data = p_method;
...@@ -131,7 +131,7 @@ static int DummyInit( input_thread_t *p_input ) ...@@ -131,7 +131,7 @@ static int DummyInit( input_thread_t *p_input )
{ {
msg_Info( p_input, "command `nop'" ); msg_Info( p_input, "command `nop'" );
p_method->i_command = COMMAND_NOP; p_method->i_command = COMMAND_NOP;
return( 0 ); return 0;
} }
/* Check for a "vlc:quit" command */ /* Check for a "vlc:quit" command */
...@@ -139,7 +139,7 @@ static int DummyInit( input_thread_t *p_input ) ...@@ -139,7 +139,7 @@ static int DummyInit( input_thread_t *p_input )
{ {
msg_Info( p_input, "command `quit'" ); msg_Info( p_input, "command `quit'" );
p_method->i_command = COMMAND_QUIT; p_method->i_command = COMMAND_QUIT;
return( 0 ); return 0;
} }
/* Check for a "vlc:loop" command */ /* Check for a "vlc:loop" command */
...@@ -147,7 +147,7 @@ static int DummyInit( input_thread_t *p_input ) ...@@ -147,7 +147,7 @@ static int DummyInit( input_thread_t *p_input )
{ {
msg_Info( p_input, "command `loop'" ); msg_Info( p_input, "command `loop'" );
p_method->i_command = COMMAND_LOOP; p_method->i_command = COMMAND_LOOP;
return( 0 ); return 0;
} }
/* Check for a "vlc:pause:***" command */ /* Check for a "vlc:pause:***" command */
...@@ -157,14 +157,14 @@ static int DummyInit( input_thread_t *p_input ) ...@@ -157,14 +157,14 @@ static int DummyInit( input_thread_t *p_input )
msg_Info( p_input, "command `pause %i'", i_arg ); msg_Info( p_input, "command `pause %i'", i_arg );
p_method->i_command = COMMAND_PAUSE; p_method->i_command = COMMAND_PAUSE;
p_method->expiration = mdate() + (mtime_t)i_arg * (mtime_t)1000000; p_method->expiration = mdate() + (mtime_t)i_arg * (mtime_t)1000000;
return( 0 ); return 0;
} }
msg_Err( p_input, "unknown command `%s'", psz_name ); msg_Err( p_input, "unknown command `%s'", psz_name );
free( p_input->p_demux_data ); free( p_input->p_demux_data );
p_input->b_error = 1; p_input->b_error = 1;
return( -1 ); return -1;
} }
/***************************************************************************** /*****************************************************************************
...@@ -181,17 +181,25 @@ static void DummyEnd( input_thread_t *p_input ) ...@@ -181,17 +181,25 @@ static void DummyEnd( input_thread_t *p_input )
static int DummyDemux( input_thread_t *p_input ) static int DummyDemux( input_thread_t *p_input )
{ {
struct demux_sys_s * p_method = p_input->p_demux_data; struct demux_sys_s * p_method = p_input->p_demux_data;
playlist_t *p_playlist;
p_playlist = vlc_object_find( p_input, VLC_OBJECT_PLAYLIST, FIND_PARENT );
if( p_playlist == NULL )
{
msg_Err( p_input, "we are not attached to a playlist" );
p_input->b_error = 1;
return 1;
}
switch( p_method->i_command ) switch( p_method->i_command )
{ {
case COMMAND_QUIT: case COMMAND_QUIT:
p_input->p_vlc->b_die = 1; p_input->p_vlc->b_die = 1;
p_input->b_die = 1;
break; break;
case COMMAND_LOOP: case COMMAND_LOOP:
//playlist_Jumpto( p_input->p_vlc->p_playlist, -1 ); playlist_Goto( p_playlist, 0 );
p_input->b_eof = 1;
break; break;
case COMMAND_PAUSE: case COMMAND_PAUSE:
...@@ -211,6 +219,8 @@ static int DummyDemux( input_thread_t *p_input ) ...@@ -211,6 +219,8 @@ static int DummyDemux( input_thread_t *p_input )
break; break;
} }
vlc_object_release( p_playlist );
return 1; return 1;
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_playlist.c : Interface for the playlist dialog * gtk_playlist.c : Interface for the playlist dialog
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: gtk_playlist.c,v 1.33 2002/06/07 14:30:41 sam Exp $ * $Id: gtk_playlist.c,v 1.34 2002/06/07 16:06:09 sam Exp $
* *
* Authors: Pierre Baillet <oct@zoy.org> * Authors: Pierre Baillet <oct@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -64,10 +64,9 @@ static void UrlDecode( char *encoded_path ); ...@@ -64,10 +64,9 @@ static void UrlDecode( char *encoded_path );
gboolean GtkPlaylistShow( GtkWidget *widget, gboolean GtkPlaylistShow( GtkWidget *widget,
gpointer user_data ) gpointer user_data )
{ {
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data ); intf_thread_t * p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
playlist_t *p_playlist; playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) if( p_playlist == NULL )
{ {
return FALSE; return FALSE;
...@@ -110,16 +109,16 @@ void GtkPlaylistCancel( GtkButton * button, gpointer user_data ) ...@@ -110,16 +109,16 @@ void GtkPlaylistCancel( GtkButton * button, gpointer user_data )
gboolean GtkPlaylistPrev( GtkWidget *widget, gboolean GtkPlaylistPrev( GtkWidget *widget,
gpointer user_data ) gpointer user_data )
{ {
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data ); intf_thread_t * p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
playlist_t *p_playlist; playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); if( p_playlist == NULL )
if( p_playlist )
{ {
return FALSE;
}
playlist_Prev( p_playlist ); playlist_Prev( p_playlist );
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
}
return TRUE; return TRUE;
} }
...@@ -128,16 +127,16 @@ gboolean GtkPlaylistPrev( GtkWidget *widget, ...@@ -128,16 +127,16 @@ gboolean GtkPlaylistPrev( GtkWidget *widget,
gboolean GtkPlaylistNext( GtkWidget *widget, gboolean GtkPlaylistNext( GtkWidget *widget,
gpointer user_data) gpointer user_data)
{ {
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data ); intf_thread_t * p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
playlist_t *p_playlist; playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); if( p_playlist == NULL )
if( p_playlist )
{ {
return FALSE;
}
playlist_Next( p_playlist ); playlist_Next( p_playlist );
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
}
return TRUE; return TRUE;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* objects.c: vlc_object_t handling * objects.c: vlc_object_t handling
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: objects.c,v 1.8 2002/06/07 14:30:41 sam Exp $ * $Id: objects.c,v 1.9 2002/06/07 16:06:09 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -181,7 +181,10 @@ void __vlc_object_destroy( vlc_object_t *p_this ) ...@@ -181,7 +181,10 @@ void __vlc_object_destroy( vlc_object_t *p_this )
while( p_this->i_refcount ) while( p_this->i_refcount )
{ {
if( i_delay == 0 ) i_delay++;
/* Don't warn immediately ... 100ms seems OK */
if( i_delay == 2 )
{ {
msg_Warn( p_this, "refcount is %i, delaying before deletion", msg_Warn( p_this, "refcount is %i, delaying before deletion",
p_this->i_refcount ); p_this->i_refcount );
...@@ -197,7 +200,6 @@ void __vlc_object_destroy( vlc_object_t *p_this ) ...@@ -197,7 +200,6 @@ void __vlc_object_destroy( vlc_object_t *p_this )
return; return;
} }
i_delay++;
msleep( 100000 ); msleep( 100000 );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* playlist.c : Playlist management functions * playlist.c : Playlist management functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: playlist.c,v 1.6 2002/06/07 14:30:41 sam Exp $ * $Id: playlist.c,v 1.7 2002/06/07 16:06:09 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -179,7 +179,16 @@ int playlist_Add( playlist_t *p_playlist, const char * psz_target, ...@@ -179,7 +179,16 @@ int playlist_Add( playlist_t *p_playlist, const char * psz_target,
} }
p_playlist->pp_items[i_pos] = p_item; p_playlist->pp_items[i_pos] = p_item;
if( i_mode & PLAYLIST_GO )
{
p_playlist->i_index = i_pos;
if( p_playlist->p_input )
{
input_StopThread( p_playlist->p_input );
}
p_playlist->i_status = PLAYLIST_RUNNING; p_playlist->i_status = PLAYLIST_RUNNING;
}
vlc_mutex_unlock( &p_playlist->object_lock ); vlc_mutex_unlock( &p_playlist->object_lock );
......
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