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 @@
0.5.0
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
vlc_object_destroy.
* ./po/pl.po: updated polish translation, thanks to Arkadiusz Lipiec
......
......@@ -2,7 +2,7 @@
* input_dummy.c: dummy input plugin, to manage "vlc:***" special options
*****************************************************************************
* 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>
*
......@@ -94,7 +94,7 @@ static int DummyOpen( input_thread_t * p_input )
/* Force dummy demux plug-in */
p_input->psz_demux = "vlc";
return( 0 );
return 0;
}
/*****************************************************************************
......@@ -120,7 +120,7 @@ static int DummyInit( input_thread_t *p_input )
if( p_method == NULL )
{
msg_Err( p_input, "out of memory" );
return( -1 );
return -1;
}
p_input->p_demux_data = p_method;
......@@ -131,7 +131,7 @@ static int DummyInit( input_thread_t *p_input )
{
msg_Info( p_input, "command `nop'" );
p_method->i_command = COMMAND_NOP;
return( 0 );
return 0;
}
/* Check for a "vlc:quit" command */
......@@ -139,7 +139,7 @@ static int DummyInit( input_thread_t *p_input )
{
msg_Info( p_input, "command `quit'" );
p_method->i_command = COMMAND_QUIT;
return( 0 );
return 0;
}
/* Check for a "vlc:loop" command */
......@@ -147,7 +147,7 @@ static int DummyInit( input_thread_t *p_input )
{
msg_Info( p_input, "command `loop'" );
p_method->i_command = COMMAND_LOOP;
return( 0 );
return 0;
}
/* Check for a "vlc:pause:***" command */
......@@ -157,14 +157,14 @@ static int DummyInit( input_thread_t *p_input )
msg_Info( p_input, "command `pause %i'", i_arg );
p_method->i_command = COMMAND_PAUSE;
p_method->expiration = mdate() + (mtime_t)i_arg * (mtime_t)1000000;
return( 0 );
return 0;
}
msg_Err( p_input, "unknown command `%s'", psz_name );
free( p_input->p_demux_data );
p_input->b_error = 1;
return( -1 );
return -1;
}
/*****************************************************************************
......@@ -181,17 +181,25 @@ static void DummyEnd( input_thread_t *p_input )
static int DummyDemux( input_thread_t *p_input )
{
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 )
{
case COMMAND_QUIT:
p_input->p_vlc->b_die = 1;
p_input->b_die = 1;
break;
case COMMAND_LOOP:
//playlist_Jumpto( p_input->p_vlc->p_playlist, -1 );
p_input->b_eof = 1;
playlist_Goto( p_playlist, 0 );
break;
case COMMAND_PAUSE:
......@@ -211,6 +219,8 @@ static int DummyDemux( input_thread_t *p_input )
break;
}
vlc_object_release( p_playlist );
return 1;
}
......@@ -2,7 +2,7 @@
* gtk_playlist.c : Interface for the playlist dialog
*****************************************************************************
* 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>
* Stphane Borel <stef@via.ecp.fr>
......@@ -64,10 +64,9 @@ static void UrlDecode( char *encoded_path );
gboolean GtkPlaylistShow( GtkWidget *widget,
gpointer user_data )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
playlist_t *p_playlist;
p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
return FALSE;
......@@ -110,17 +109,17 @@ void GtkPlaylistCancel( GtkButton * button, gpointer user_data )
gboolean GtkPlaylistPrev( GtkWidget *widget,
gpointer user_data )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
playlist_t *p_playlist;
p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist )
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
playlist_Prev( p_playlist );
vlc_object_release( p_playlist );
return FALSE;
}
playlist_Prev( p_playlist );
vlc_object_release( p_playlist );
return TRUE;
}
......@@ -128,17 +127,17 @@ gboolean GtkPlaylistPrev( GtkWidget *widget,
gboolean GtkPlaylistNext( GtkWidget *widget,
gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
playlist_t *p_playlist;
p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist )
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
playlist_Next( p_playlist );
vlc_object_release( p_playlist );
return FALSE;
}
playlist_Next( p_playlist );
vlc_object_release( p_playlist );
return TRUE;
}
......
......@@ -2,7 +2,7 @@
* objects.c: vlc_object_t handling
*****************************************************************************
* 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>
*
......@@ -181,7 +181,10 @@ void __vlc_object_destroy( vlc_object_t *p_this )
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",
p_this->i_refcount );
......@@ -197,7 +200,6 @@ void __vlc_object_destroy( vlc_object_t *p_this )
return;
}
i_delay++;
msleep( 100000 );
}
......
......@@ -2,7 +2,7 @@
* playlist.c : Playlist management functions
*****************************************************************************
* 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>
*
......@@ -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->i_status = PLAYLIST_RUNNING;
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;
}
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