Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
c149ea80
Commit
c149ea80
authored
Aug 19, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xspf: simplify.
parent
55f81512
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
31 deletions
+22
-31
modules/demux/playlist/xspf.c
modules/demux/playlist/xspf.c
+22
-31
No files found.
modules/demux/playlist/xspf.c
View file @
c149ea80
...
@@ -79,7 +79,7 @@ void Close_xspf( vlc_object_t *p_this )
...
@@ -79,7 +79,7 @@ void Close_xspf( vlc_object_t *p_this )
*/
*/
int
Demux
(
demux_t
*
p_demux
)
int
Demux
(
demux_t
*
p_demux
)
{
{
int
i_ret
=
1
;
int
i_ret
=
-
1
;
xml_t
*
p_xml
=
NULL
;
xml_t
*
p_xml
=
NULL
;
xml_reader_t
*
p_xml_reader
=
NULL
;
xml_reader_t
*
p_xml_reader
=
NULL
;
char
*
psz_name
=
NULL
;
char
*
psz_name
=
NULL
;
...
@@ -92,45 +92,35 @@ int Demux( demux_t *p_demux )
...
@@ -92,45 +92,35 @@ int Demux( demux_t *p_demux )
/* create new xml parser from stream */
/* create new xml parser from stream */
p_xml
=
xml_Create
(
p_demux
);
p_xml
=
xml_Create
(
p_demux
);
if
(
!
p_xml
)
if
(
!
p_xml
)
i_ret
=
-
1
;
goto
end
;
else
{
p_xml_reader
=
xml_ReaderCreate
(
p_xml
,
p_demux
->
s
);
p_xml_reader
=
xml_ReaderCreate
(
p_xml
,
p_demux
->
s
);
if
(
!
p_xml_reader
)
if
(
!
p_xml_reader
)
i_ret
=
-
1
;
goto
end
;
}
/* locating the root node */
/* locating the root node */
if
(
i_ret
==
1
)
{
do
do
{
{
if
(
xml_ReaderRead
(
p_xml_reader
)
!=
1
)
if
(
xml_ReaderRead
(
p_xml_reader
)
!=
1
)
{
{
msg_Err
(
p_demux
,
"can't read xml stream"
);
msg_Err
(
p_demux
,
"can't read xml stream"
);
i_ret
=
-
1
;
goto
end
;
}
}
while
(
i_ret
==
VLC_SUCCESS
&&
xml_ReaderNodeType
(
p_xml_reader
)
!=
XML_READER_STARTELEM
);
}
}
}
while
(
xml_ReaderNodeType
(
p_xml_reader
)
!=
XML_READER_STARTELEM
);
/* checking root node name */
/* checking root node name */
if
(
i_ret
==
1
)
{
psz_name
=
xml_ReaderName
(
p_xml_reader
);
psz_name
=
xml_ReaderName
(
p_xml_reader
);
if
(
!
psz_name
||
strcmp
(
psz_name
,
"playlist"
)
)
if
(
!
psz_name
||
strcmp
(
psz_name
,
"playlist"
)
)
{
{
msg_Err
(
p_demux
,
"invalid root node name: %s"
,
psz_name
);
msg_Err
(
p_demux
,
"invalid root node name: %s"
,
psz_name
);
i_ret
=
-
1
;
goto
end
;
}
FREE_NAME
();
}
}
free
(
psz_name
);
if
(
i_ret
==
1
)
i_ret
=
parse_playlist_node
(
p_demux
,
p_current_input
,
i_ret
=
parse_playlist_node
(
p_demux
,
p_current_input
,
p_xml_reader
,
"playlist"
)
?
0
:
-
1
;
p_xml_reader
,
"playlist"
)
?
0
:
-
1
;
int
i
;
for
(
int
i
=
0
;
i
<
p_demux
->
p_sys
->
i_tracklist_entries
;
i
++
)
for
(
i
=
0
;
i
<
p_demux
->
p_sys
->
i_tracklist_entries
;
i
++
)
{
{
input_item_t
*
p_new_input
=
p_demux
->
p_sys
->
pp_tracklist
[
i
];
input_item_t
*
p_new_input
=
p_demux
->
p_sys
->
pp_tracklist
[
i
];
if
(
p_new_input
)
if
(
p_new_input
)
...
@@ -139,6 +129,7 @@ int Demux( demux_t *p_demux )
...
@@ -139,6 +129,7 @@ int Demux( demux_t *p_demux )
}
}
}
}
end:
HANDLE_PLAY_AND_RELEASE
;
HANDLE_PLAY_AND_RELEASE
;
if
(
p_xml_reader
)
if
(
p_xml_reader
)
xml_ReaderDelete
(
p_xml
,
p_xml_reader
);
xml_ReaderDelete
(
p_xml
,
p_xml_reader
);
...
...
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