[vlc-devel] commit: playlist: allow non-recursive search (Jakob Leben )
git version control
git at videolan.org
Fri Feb 12 11:46:55 CET 2010
vlc | branch: master | Jakob Leben <jleben at videolan.org> | Fri Feb 12 11:42:12 2010 +0100| [c3d342a2d5bd2d2534f8a34be9de7a1557b60ea9] | committer: Jakob Leben
playlist: allow non-recursive search
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c3d342a2d5bd2d2534f8a34be9de7a1557b60ea9
---
include/vlc_playlist.h | 2 +-
modules/misc/lua/libs/playlist.c | 2 +-
src/playlist/search.c | 10 +++++-----
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h
index 061e761..181e529 100644
--- a/include/vlc_playlist.h
+++ b/include/vlc_playlist.h
@@ -353,7 +353,7 @@ VLC_EXPORT( playlist_item_t *, playlist_NodeAddInput, ( playlist_t *, input_item
VLC_EXPORT( playlist_item_t *, playlist_ItemGetById, (playlist_t *, int ) );
VLC_EXPORT( playlist_item_t *, playlist_ItemGetByInput, (playlist_t *,input_item_t * ) );
-VLC_EXPORT( int, playlist_LiveSearchUpdate, (playlist_t *, playlist_item_t *, const char *) );
+VLC_EXPORT( int, playlist_LiveSearchUpdate, (playlist_t *, playlist_item_t *, const char *, bool ) );
/********************************************************
* Tree management
diff --git a/modules/misc/lua/libs/playlist.c b/modules/misc/lua/libs/playlist.c
index b376ba5..f7d9d10 100644
--- a/modules/misc/lua/libs/playlist.c
+++ b/modules/misc/lua/libs/playlist.c
@@ -265,7 +265,7 @@ static int vlclua_playlist_search( lua_State *L )
playlist_t *p_playlist = vlclua_get_playlist_internal( L );
const char *psz_string = luaL_optstring( L, 1, "" );
PL_LOCK;
- playlist_LiveSearchUpdate( p_playlist, p_playlist->p_root, psz_string );
+ playlist_LiveSearchUpdate( p_playlist, p_playlist->p_root, psz_string, true );
PL_UNLOCK;
push_playlist_item( L, p_playlist->p_root );
return 1;
diff --git a/src/playlist/search.c b/src/playlist/search.c
index 8de86c6..773496e 100644
--- a/src/playlist/search.c
+++ b/src/playlist/search.c
@@ -107,7 +107,7 @@ static void playlist_LiveSearchClean( playlist_item_t *p_root )
* @return true if an item match
*/
static bool playlist_LiveSearchUpdateInternal( playlist_item_t *p_root,
- const char *psz_string )
+ const char *psz_string, bool b_recursive )
{
int i;
bool b_match = false;
@@ -116,8 +116,8 @@ static bool playlist_LiveSearchUpdateInternal( playlist_item_t *p_root,
bool b_enable = false;
playlist_item_t *p_item = p_root->pp_children[i];
// Go recurssively if their is some children
- if( p_item->i_children >= 0 &&
- playlist_LiveSearchUpdateInternal( p_item, psz_string ) )
+ if( b_recursive && p_item->i_children >= 0 &&
+ playlist_LiveSearchUpdateInternal( p_item, psz_string, true ) )
{
b_enable = true;
}
@@ -163,12 +163,12 @@ static bool playlist_LiveSearchUpdateInternal( playlist_item_t *p_root,
* @return VLC_SUCCESS
*/
int playlist_LiveSearchUpdate( playlist_t *p_playlist, playlist_item_t *p_root,
- const char *psz_string )
+ const char *psz_string, bool b_recursive )
{
PL_ASSERT_LOCKED;
pl_priv(p_playlist)->b_reset_currently_playing = true;
if( *psz_string )
- playlist_LiveSearchUpdateInternal( p_root, psz_string );
+ playlist_LiveSearchUpdateInternal( p_root, psz_string, b_recursive );
else
playlist_LiveSearchClean( p_root );
vlc_cond_signal( &pl_priv(p_playlist)->signal );
More information about the vlc-devel
mailing list