Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
6357ef21
Commit
6357ef21
authored
Oct 10, 2008
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix potential segfault and move code (CID 178)
parent
bcd40e9a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
72 deletions
+58
-72
modules/control/http/util.c
modules/control/http/util.c
+58
-72
No files found.
modules/control/http/util.c
View file @
6357ef21
...
...
@@ -345,95 +345,81 @@ void PlaylistListNode( intf_thread_t *p_intf, playlist_t *p_pl,
playlist_item_t
*
p_node
,
char
*
name
,
mvar_t
*
s
,
int
i_depth
)
{
if
(
p_node
!=
NULL
)
{
if
(
p_node
->
i_children
==
-
1
)
{
char
value
[
512
];
char
*
psz
;
mvar_t
*
itm
=
mvar_New
(
name
,
"set"
);
playlist_item_t
*
p_item
=
playlist_CurrentPlayingItem
(
p_pl
);
if
(
p_item
&&
p_node
&&
p_item
->
p_input
&&
p_node
->
p_input
&&
p_item
->
p_input
->
i_id
==
p_node
->
p_input
->
i_id
)
{
mvar_AppendNewVar
(
itm
,
"current"
,
"1"
);
}
else
{
mvar_AppendNewVar
(
itm
,
"current"
,
"0"
);
}
if
(
!
p_node
||
!
p_node
->
p_input
)
return
;
sprintf
(
value
,
"%d"
,
p_node
->
i_id
);
mvar_AppendNewVar
(
itm
,
"index"
,
value
);
psz
=
input_item_GetName
(
p_node
->
p_input
);
mvar_AppendNewVar
(
itm
,
"name"
,
psz
);
free
(
psz
);
if
(
p_node
->
i_children
==
-
1
)
{
char
value
[
512
];
char
*
psz
;
mvar_t
*
itm
=
mvar_New
(
name
,
"set"
);
playlist_item_t
*
p_item
=
playlist_CurrentPlayingItem
(
p_pl
);
if
(
!
p_item
||
!
p_item
->
p_input
)
return
;
if
(
p_item
->
p_input
->
i_id
==
p_node
->
p_input
->
i_id
)
mvar_AppendNewVar
(
itm
,
"current"
,
"1"
);
else
mvar_AppendNewVar
(
itm
,
"current"
,
"0"
);
psz
=
input_item_GetURI
(
p_node
->
p_input
);
mvar_AppendNewVar
(
itm
,
"uri"
,
psz
);
free
(
psz
);
sprintf
(
value
,
"%d"
,
p_node
->
i_id
);
mvar_AppendNewVar
(
itm
,
"index"
,
value
);
sprintf
(
value
,
"Item"
);
mvar_AppendNewVar
(
itm
,
"type"
,
value
);
psz
=
input_item_GetName
(
p_node
->
p_input
);
mvar_AppendNewVar
(
itm
,
"name"
,
psz
);
free
(
psz
);
sprintf
(
value
,
"%d"
,
i_depth
);
mvar_AppendNewVar
(
itm
,
"depth"
,
value
);
psz
=
input_item_GetURI
(
p_node
->
p_input
);
mvar_AppendNewVar
(
itm
,
"uri"
,
psz
);
free
(
psz
);
if
(
p_node
->
i_flags
&
PLAYLIST_RO_FLAG
)
{
mvar_AppendNewVar
(
itm
,
"ro"
,
"ro"
);
}
else
{
mvar_AppendNewVar
(
itm
,
"ro"
,
"rw"
);
}
sprintf
(
value
,
"Item"
);
mvar_AppendNewVar
(
itm
,
"type"
,
value
);
sprintf
(
value
,
"%ld"
,
(
long
)
input_item_GetDuration
(
p_node
->
p_input
)
);
mvar_AppendNewVar
(
itm
,
"duration"
,
value
);
sprintf
(
value
,
"%d"
,
i_depth
);
mvar_AppendNewVar
(
itm
,
"depth"
,
value
);
mvar_AppendVar
(
s
,
itm
);
}
if
(
p_node
->
i_flags
&
PLAYLIST_RO_FLAG
)
mvar_AppendNewVar
(
itm
,
"ro"
,
"ro"
);
else
{
char
value
[
512
];
int
i_child
;
mvar_t
*
itm
=
mvar_New
(
name
,
"set"
);
mvar_AppendNewVar
(
itm
,
"ro"
,
"rw"
);
mvar_AppendNewVar
(
itm
,
"name"
,
p_node
->
p_input
->
psz_name
);
mvar_AppendNewVar
(
itm
,
"uri"
,
p_node
->
p_input
->
psz_name
);
sprintf
(
value
,
"%ld"
,
(
long
)
input_item_GetDuration
(
p_node
->
p_input
)
);
mvar_AppendNewVar
(
itm
,
"duration"
,
value
);
sprintf
(
value
,
"Node"
);
mvar_AppendNewVar
(
itm
,
"type"
,
value
);
mvar_AppendVar
(
s
,
itm
);
}
else
{
char
value
[
512
];
int
i_child
;
mvar_t
*
itm
=
mvar_New
(
name
,
"set"
);
sprintf
(
value
,
"%d"
,
p_node
->
i_id
);
mvar_AppendNewVar
(
itm
,
"index"
,
valu
e
);
mvar_AppendNewVar
(
itm
,
"name"
,
p_node
->
p_input
->
psz_name
);
mvar_AppendNewVar
(
itm
,
"uri"
,
p_node
->
p_input
->
psz_nam
e
);
sprintf
(
value
,
"%d"
,
p_node
->
i_children
);
mvar_AppendNewVar
(
itm
,
"i_children
"
,
value
);
sprintf
(
value
,
"Node"
);
mvar_AppendNewVar
(
itm
,
"type
"
,
value
);
sprintf
(
value
,
"%d"
,
i_depth
);
mvar_AppendNewVar
(
itm
,
"depth
"
,
value
);
sprintf
(
value
,
"%d"
,
p_node
->
i_id
);
mvar_AppendNewVar
(
itm
,
"index
"
,
value
);
if
(
p_node
->
i_flags
&
PLAYLIST_RO_FLAG
)
{
mvar_AppendNewVar
(
itm
,
"ro"
,
"ro"
);
}
else
{
mvar_AppendNewVar
(
itm
,
"ro"
,
"rw"
);
}
sprintf
(
value
,
"%d"
,
p_node
->
i_children
);
mvar_AppendNewVar
(
itm
,
"i_children"
,
value
);
mvar_AppendVar
(
s
,
itm
);
sprintf
(
value
,
"%d"
,
i_depth
);
mvar_AppendNewVar
(
itm
,
"depth"
,
value
);
for
(
i_child
=
0
;
i_child
<
p_node
->
i_children
;
i_child
++
)
PlaylistListNode
(
p_intf
,
p_pl
,
p_node
->
pp_children
[
i_child
],
name
,
s
,
i_depth
+
1
);
if
(
p_node
->
i_flags
&
PLAYLIST_RO_FLAG
)
mvar_AppendNewVar
(
itm
,
"ro"
,
"ro"
);
else
mvar_AppendNewVar
(
itm
,
"ro"
,
"rw"
);
}
mvar_AppendVar
(
s
,
itm
);
for
(
i_child
=
0
;
i_child
<
p_node
->
i_children
;
i_child
++
)
PlaylistListNode
(
p_intf
,
p_pl
,
p_node
->
pp_children
[
i_child
],
name
,
s
,
i_depth
+
1
);
}
}
...
...
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