Commit e56afee7 authored by gbazin's avatar gbazin

* src/misc/modules.c: module_Need() probed sub-modules twice.

* playlist/playlist.c: with autodeletion, destroy the input before deleting the playlist item (shared data between both).
parent e590028f
......@@ -403,7 +403,6 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability,
/* Parse the module list for capabilities and probe each of them */
for( i_which_module = 0; i_which_module < p_all->i_count; i_which_module++ )
{
module_t * p_submodule = NULL;
int i_shortcut_bonus = 0, i_submodule;
p_module = (module_t *)p_all->p_values[i_which_module].p_object;
......@@ -411,25 +410,9 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability,
/* Test that this module can do what we need */
if( strcmp( p_module->psz_capability, psz_capability ) )
{
for( i_submodule = 0;
i_submodule < p_module->i_children;
i_submodule++ )
{
if( !strcmp( ((module_t*)p_module->pp_children[ i_submodule ])
->psz_capability, psz_capability ) )
{
p_submodule =
(module_t*)p_module->pp_children[ i_submodule ];
break;
}
}
if( p_submodule == NULL )
{
continue;
}
p_module = p_submodule;
/* Don't recurse through the sub-modules because vlc_list_find()
* will list them anyway. */
continue;
}
/* Test if we have the required CPU */
......
......@@ -355,6 +355,18 @@ static void RunThread ( playlist_t *p_playlist )
i_vout_destroyed_date = 0;
i_sout_destroyed_date = 0;
/* Check for autodeletion */
if( p_playlist->pp_items[p_playlist->i_index]->b_autodeletion )
{
playlist_Delete( p_playlist, p_playlist->i_index );
}
/* Select the next playlist item */
vlc_mutex_lock( &p_playlist->object_lock );
SkipItem( p_playlist, 1 );
vlc_mutex_unlock( &p_playlist->object_lock );
continue;
}
/* This input is dying, let him do */
......@@ -366,21 +378,9 @@ static void RunThread ( playlist_t *p_playlist )
else if( p_playlist->p_input->b_error
|| p_playlist->p_input->b_eof )
{
/* Check for autodeletion */
if( p_playlist->pp_items[p_playlist->i_index]->b_autodeletion )
{
vlc_mutex_unlock( &p_playlist->object_lock );
playlist_Delete( p_playlist, p_playlist->i_index );
p_playlist->i_index++;
p_playlist->i_status = PLAYLIST_RUNNING;
}
else
{
/* Select the next playlist item */
SkipItem( p_playlist, 1 );
input_StopThread( p_playlist->p_input );
vlc_mutex_unlock( &p_playlist->object_lock );
}
input_StopThread( p_playlist->p_input );
vlc_mutex_unlock( &p_playlist->object_lock );
continue;
}
else if( p_playlist->p_input->i_state != INIT_S )
......
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