Commit 5eb23c8e authored by Clément Stenac's avatar Clément Stenac

Restore loop

Fix command line parsing
parent d2adc9f3
...@@ -212,6 +212,7 @@ char * __config_GetPsz( vlc_object_t *p_this, const char *psz_name ) ...@@ -212,6 +212,7 @@ char * __config_GetPsz( vlc_object_t *p_this, const char *psz_name )
return NULL; return NULL;
} }
/* return a copy of the string */ /* return a copy of the string */
vlc_mutex_lock( p_config->p_lock ); vlc_mutex_lock( p_config->p_lock );
if( p_config->psz_value ) psz_value = strdup( p_config->psz_value ); if( p_config->psz_value ) psz_value = strdup( p_config->psz_value );
...@@ -235,6 +236,7 @@ void __config_PutPsz( vlc_object_t *p_this, ...@@ -235,6 +236,7 @@ void __config_PutPsz( vlc_object_t *p_this,
p_config = config_FindConfig( p_this, psz_name ); p_config = config_FindConfig( p_this, psz_name );
/* sanity checks */ /* sanity checks */
if( !p_config ) if( !p_config )
{ {
...@@ -245,6 +247,7 @@ void __config_PutPsz( vlc_object_t *p_this, ...@@ -245,6 +247,7 @@ void __config_PutPsz( vlc_object_t *p_this,
(p_config->i_type!=CONFIG_ITEM_FILE) && (p_config->i_type!=CONFIG_ITEM_FILE) &&
(p_config->i_type!=CONFIG_ITEM_DIRECTORY) && (p_config->i_type!=CONFIG_ITEM_DIRECTORY) &&
(p_config->i_type!=CONFIG_ITEM_MODULE_LIST) && (p_config->i_type!=CONFIG_ITEM_MODULE_LIST) &&
(p_config->i_type!=CONFIG_ITEM_MODULE_CAT) &&
(p_config->i_type!=CONFIG_ITEM_MODULE_LIST_CAT) && (p_config->i_type!=CONFIG_ITEM_MODULE_LIST_CAT) &&
(p_config->i_type!=CONFIG_ITEM_MODULE) ) (p_config->i_type!=CONFIG_ITEM_MODULE) )
{ {
...@@ -1444,6 +1447,9 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[], ...@@ -1444,6 +1447,9 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[],
case CONFIG_ITEM_FILE: case CONFIG_ITEM_FILE:
case CONFIG_ITEM_DIRECTORY: case CONFIG_ITEM_DIRECTORY:
case CONFIG_ITEM_MODULE: case CONFIG_ITEM_MODULE:
case CONFIG_ITEM_MODULE_LIST:
case CONFIG_ITEM_MODULE_LIST_CAT:
case CONFIG_ITEM_MODULE_CAT:
config_PutPsz( p_this, psz_name, optarg ); config_PutPsz( p_this, psz_name, optarg );
break; break;
case CONFIG_ITEM_INTEGER: case CONFIG_ITEM_INTEGER:
...@@ -1472,6 +1478,9 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[], ...@@ -1472,6 +1478,9 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[],
case CONFIG_ITEM_FILE: case CONFIG_ITEM_FILE:
case CONFIG_ITEM_DIRECTORY: case CONFIG_ITEM_DIRECTORY:
case CONFIG_ITEM_MODULE: case CONFIG_ITEM_MODULE:
case CONFIG_ITEM_MODULE_CAT:
case CONFIG_ITEM_MODULE_LIST:
case CONFIG_ITEM_MODULE_LIST_CAT:
config_PutPsz( p_this, pp_shortopts[i_cmd]->psz_name, optarg ); config_PutPsz( p_this, pp_shortopts[i_cmd]->psz_name, optarg );
break; break;
case CONFIG_ITEM_INTEGER: case CONFIG_ITEM_INTEGER:
......
...@@ -870,7 +870,22 @@ static playlist_item_t * NextItem( playlist_t *p_playlist ) ...@@ -870,7 +870,22 @@ static playlist_item_t * NextItem( playlist_t *p_playlist )
p_view->p_root, p_view->p_root,
p_playlist->request.p_node, p_playlist->request.p_node,
p_new ); p_new );
if( p_new == NULL ) break; if( p_new == NULL )
{
if( b_loop )
{
p_new = playlist_FindNextFromParent( p_playlist,
p_playlist->request.i_view,
p_view->p_root,
p_playlist->request.p_node,
NULL );
if( p_new == NULL ) break;
}
else
{
break;
}
}
} }
} }
else if( i_skip < 0 ) else if( i_skip < 0 )
...@@ -909,7 +924,13 @@ static playlist_item_t * NextItem( playlist_t *p_playlist ) ...@@ -909,7 +924,13 @@ static playlist_item_t * NextItem( playlist_t *p_playlist )
else else
{ {
msg_Dbg( p_playlist,"finished" ); msg_Dbg( p_playlist,"finished" );
p_new = NULL; if( b_loop && p_playlist->i_size > 0)
{
p_playlist->i_index = 0;
p_new = p_playlist->pp_items[0];
}
else
p_new = NULL;
} }
} }
/* We are playing with a view */ /* We are playing with a view */
...@@ -923,6 +944,14 @@ static playlist_item_t * NextItem( playlist_t *p_playlist ) ...@@ -923,6 +944,14 @@ static playlist_item_t * NextItem( playlist_t *p_playlist )
p_view->p_root, p_view->p_root,
p_playlist->status.p_node, p_playlist->status.p_node,
p_playlist->status.p_item ); p_playlist->status.p_item );
if( p_new == NULL && b_loop )
{
p_new = playlist_FindNextFromParent( p_playlist,
p_playlist->status.i_view,
p_view->p_root,
p_playlist->status.p_node,
NULL );
}
} }
} }
...@@ -938,8 +967,10 @@ static playlist_item_t * NextItem( playlist_t *p_playlist ) ...@@ -938,8 +967,10 @@ static playlist_item_t * NextItem( playlist_t *p_playlist )
msg_Dbg(p_playlist,"next item found in "I64Fi " us", mdate()-start ); msg_Dbg(p_playlist,"next item found in "I64Fi " us", mdate()-start );
#endif #endif
if( p_new == NULL ) { msg_Info( p_playlist, "Nothing to play" ); } if( p_new == NULL )
{
msg_Info( p_playlist, "Nothing to play" );
}
return p_new; return p_new;
} }
......
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