Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
6dafd7ff
Commit
6dafd7ff
authored
Feb 05, 2010
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lua: adjust to playlist changes and kill a warning
now services discovery root nodes can be found from lua
parent
22a9f08b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
34 deletions
+11
-34
modules/misc/lua/libs/playlist.c
modules/misc/lua/libs/playlist.c
+11
-34
No files found.
modules/misc/lua/libs/playlist.c
View file @
6dafd7ff
...
...
@@ -234,7 +234,6 @@ static int vlclua_playlist_get( lua_State *L )
{
playlist_t
*
p_playlist
=
vlclua_get_playlist_internal
(
L
);
PL_LOCK
;
int
b_category
=
luaL_optboolean
(
L
,
2
,
1
);
/* Default to tree playlist (discared when 1st argument is a playlist_item's id) */
playlist_item_t
*
p_item
=
NULL
;
if
(
lua_isnumber
(
L
,
1
)
)
...
...
@@ -253,32 +252,17 @@ static int vlclua_playlist_get( lua_State *L )
const
char
*
psz_what
=
lua_tostring
(
L
,
1
);
if
(
!
strcasecmp
(
psz_what
,
"normal"
)
||
!
strcasecmp
(
psz_what
,
"playlist"
)
)
p_item
=
b_category
?
p_playlist
->
p_local_category
:
p_playlist
->
p_local_onelevel
;
p_item
=
p_playlist
->
p_playing
;
else
if
(
!
strcasecmp
(
psz_what
,
"ml"
)
||
!
strcasecmp
(
psz_what
,
"media library"
)
)
p_item
=
b_category
?
p_playlist
->
p_ml_category
:
p_playlist
->
p_ml_onelevel
;
p_item
=
p_playlist
->
p_media_library
;
else
if
(
!
strcasecmp
(
psz_what
,
"root"
)
)
p_item
=
b_category
?
p_playlist
->
p_root_category
:
p_playlist
->
p_root_onelevel
;
p_item
=
p_playlist
->
p_root
;
else
{
#ifdef FIX_THAT_CODE_NOT_TO_MESS_WITH_PLAYLIST_INTERNALS
for
(
int
i
=
0
;
i
<
p_playlist
->
i_sds
;
i
++
)
{
if
(
!
strcasecmp
(
psz_what
,
p_playlist
->
pp_sds
[
i
]
->
p_sd
->
psz_module
)
)
{
p_item
=
b_category
?
p_playlist
->
pp_sds
[
i
]
->
p_cat
:
p_playlist
->
pp_sds
[
i
]
->
p_one
;
break
;
}
}
#else
# warning "Don't access playlist iternal, broken code here."
abort
();
#endif
/* currently, psz_what must be SD module's longname! */
p_item
=
playlist_ChildSearchName
(
p_playlist
->
p_root
,
psz_what
);
if
(
!
p_item
)
{
PL_UNLOCK
;
...
...
@@ -289,8 +273,7 @@ static int vlclua_playlist_get( lua_State *L )
}
else
{
p_item
=
b_category
?
p_playlist
->
p_root_category
:
p_playlist
->
p_root_onelevel
;
p_item
=
p_playlist
->
p_root
;
}
push_playlist_item
(
L
,
p_item
);
PL_UNLOCK
;
...
...
@@ -302,13 +285,10 @@ 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
,
""
);
int
b_category
=
luaL_optboolean
(
L
,
2
,
1
);
/* default to category */
playlist_item_t
*
p_item
=
b_category
?
p_playlist
->
p_root_category
:
p_playlist
->
p_root_onelevel
;
PL_LOCK
;
playlist_LiveSearchUpdate
(
p_playlist
,
p_
item
,
psz_string
);
playlist_LiveSearchUpdate
(
p_playlist
,
p_
playlist
->
p_root
,
psz_string
);
PL_UNLOCK
;
push_playlist_item
(
L
,
p_
item
);
push_playlist_item
(
L
,
p_
playlist
->
p_root
);
vlclua_release_playlist_internal
(
p_playlist
);
return
1
;
}
...
...
@@ -366,13 +346,10 @@ static int vlclua_playlist_sort( lua_State *L )
if
(
i_mode
==
-
1
)
return
luaL_error
(
L
,
"Invalid search key."
);
int
i_type
=
luaL_optboolean
(
L
,
2
,
0
)
?
ORDER_REVERSE
:
ORDER_NORMAL
;
int
b_category
=
luaL_optboolean
(
L
,
3
,
1
);
/* default to category */
playlist_t
*
p_playlist
=
vlclua_get_playlist_internal
(
L
);
PL_LOCK
;
playlist_item_t
*
p_root
=
b_category
?
p_playlist
->
p_local_category
:
p_playlist
->
p_local_onelevel
;
int
i_ret
=
playlist_RecursiveNodeSort
(
p_playlist
,
p_root
,
i_mode
,
i_type
);
int
i_ret
=
playlist_RecursiveNodeSort
(
p_playlist
,
p_playlist
->
p_playing
,
i_mode
,
i_type
);
PL_UNLOCK
;
vlclua_release_playlist_internal
(
p_playlist
);
return
vlclua_push_ret
(
L
,
i_ret
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment