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
8a677b6a
Commit
8a677b6a
authored
Jul 15, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
itml: factorize.
parent
5d81c926
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
36 deletions
+28
-36
modules/demux/playlist/itml.c
modules/demux/playlist/itml.c
+28
-36
No files found.
modules/demux/playlist/itml.c
View file @
8a677b6a
...
...
@@ -67,64 +67,56 @@ void Close_iTML( vlc_object_t *p_this )
*/
int
Demux
(
demux_t
*
p_demux
)
{
int
i_ret
=
VLC_SUCCESS
;
xml_t
*
p_xml
=
NULL
;
xml_reader_t
*
p_xml_reader
=
NULL
;
char
*
psz_name
=
NULL
;
INIT_PLAYLIST_STUFF
;
p_demux
->
p_sys
->
i_ntracks
=
0
;
/* create new xml parser from stream */
p_xml
=
xml_Create
(
p_demux
);
if
(
!
p_xml
)
i_ret
=
VLC_ENOMOD
;
else
{
p_xml_reader
=
xml_ReaderCreate
(
p_xml
,
p_demux
->
s
);
if
(
!
p_xml_reader
)
i_ret
=
VLC_EGENERIC
;
}
goto
end
;
p_xml_reader
=
xml_ReaderCreate
(
p_xml
,
p_demux
->
s
);
if
(
!
p_xml_reader
)
goto
end
;
/* locating the root node */
if
(
i_ret
==
VLC_SUCCESS
)
{
do
{
if
(
xml_ReaderRead
(
p_xml_reader
)
!=
1
)
{
msg_Err
(
p_demux
,
"can't read xml stream"
);
i_ret
=
VLC_EGENERIC
;
}
}
while
(
i_ret
==
VLC_SUCCESS
&&
xml_ReaderNodeType
(
p_xml_reader
)
!=
XML_READER_STARTELEM
);
}
/* checking root node name */
if
(
i_ret
==
VLC_SUCCESS
)
do
{
psz_name
=
xml_ReaderName
(
p_xml_reader
);
if
(
!
psz_name
||
strcmp
(
psz_name
,
"plist"
)
)
if
(
xml_ReaderRead
(
p_xml_reader
)
!=
1
)
{
msg_Err
(
p_demux
,
"
invalid root node name: %s"
,
psz_name
);
i_ret
=
VLC_EGENERIC
;
msg_Err
(
p_demux
,
"
can't read xml stream"
);
goto
end
;
}
FREE_NAME
();
}
}
while
(
xml_ReaderNodeType
(
p_xml_reader
)
!=
XML_READER_STARTELEM
);
if
(
i_ret
==
VLC_SUCCESS
)
/* checking root node name */
psz_name
=
xml_ReaderName
(
p_xml_reader
);
if
(
!
psz_name
||
strcmp
(
psz_name
,
"plist"
)
)
{
xml_elem_hnd_t
pl_elements
[]
=
{
{
"dict"
,
COMPLEX_CONTENT
,
{.
cmplx
=
parse_plist_dict
}
}
};
i_ret
=
parse_plist_node
(
p_demux
,
p_current_input
,
NULL
,
p_xml_reader
,
"plist"
,
pl_elements
);
HANDLE_PLAY_AND_RELEASE
;
msg_Err
(
p_demux
,
"invalid root node name: %s"
,
psz_name
);
goto
end
;
}
xml_elem_hnd_t
pl_elements
[]
=
{
{
"dict"
,
COMPLEX_CONTENT
,
{.
cmplx
=
parse_plist_dict
}
}
};
parse_plist_node
(
p_demux
,
p_current_input
,
NULL
,
p_xml_reader
,
"plist"
,
pl_elements
);
HANDLE_PLAY_AND_RELEASE
;
end:
free
(
psz_name
);
if
(
p_xml_reader
)
xml_ReaderDelete
(
p_xml
,
p_xml_reader
);
if
(
p_xml
)
xml_Delete
(
p_xml
);
return
0
;
/* Needed for correct operation of go back */
/* Needed for correct operation of go back */
return
0
;
}
/** \brief dummy function for demux callback interface */
...
...
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