Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
9d546a7e
Commit
9d546a7e
authored
Jul 15, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
itml: indentation.
parent
72ddabb8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
83 deletions
+78
-83
modules/demux/playlist/itml.c
modules/demux/playlist/itml.c
+78
-83
No files found.
modules/demux/playlist/itml.c
View file @
9d546a7e
...
...
@@ -194,98 +194,93 @@ static bool parse_dict( demux_t *p_demux, input_item_t *p_input_item,
i_node
=
xml_ReaderNodeType
(
p_xml_reader
);
switch
(
i_node
)
{
case
XML_READER_NONE
:
break
;
case
XML_READER_NONE
:
break
;
case
XML_READER_STARTELEM
:
/* element start tag */
psz_name
=
xml_ReaderName
(
p_xml_reader
);
if
(
!
psz_name
||
!*
psz_name
)
{
msg_Err
(
p_demux
,
"invalid xml stream"
);
goto
end
;
}
/* choose handler */
for
(
p_handler
=
p_handlers
;
case
XML_READER_STARTELEM
:
/* element start tag */
psz_name
=
xml_ReaderName
(
p_xml_reader
);
if
(
!
psz_name
||
!*
psz_name
)
{
msg_Err
(
p_demux
,
"invalid xml stream"
);
goto
end
;
}
/* choose handler */
for
(
p_handler
=
p_handlers
;
p_handler
->
name
&&
strcmp
(
psz_name
,
p_handler
->
name
);
p_handler
++
);
if
(
!
p_handler
->
name
)
{
msg_Err
(
p_demux
,
"unexpected element <%s>"
,
psz_name
);
goto
end
;
}
FREE_NAME
();
/* complex content is parsed in a separate function */
if
(
p_handler
->
type
==
COMPLEX_CONTENT
)
if
(
!
p_handler
->
name
)
{
msg_Err
(
p_demux
,
"unexpected element <%s>"
,
psz_name
);
goto
end
;
}
FREE_NAME
();
/* complex content is parsed in a separate function */
if
(
p_handler
->
type
==
COMPLEX_CONTENT
)
{
if
(
p_handler
->
pf_handler
.
cmplx
(
p_demux
,
p_input_item
,
NULL
,
p_xml_reader
,
p_handler
->
name
,
NULL
)
)
{
if
(
p_handler
->
pf_handler
.
cmplx
(
p_demux
,
p_input_item
,
NULL
,
p_xml_reader
,
p_handler
->
name
,
NULL
)
)
{
p_handler
=
NULL
;
FREE_ATT_KEY
();
}
else
{
goto
end
;
}
p_handler
=
NULL
;
FREE_ATT_KEY
();
}
break
;
case
XML_READER_TEXT
:
/* simple element content */
free
(
psz_value
);
psz_value
=
xml_ReaderValue
(
p_xml_reader
);
if
(
!
psz_value
)
{
msg_Err
(
p_demux
,
"invalid xml stream"
);
else
goto
end
;
}
break
;
}
break
;
case
XML_READER_ENDELEM
:
/* element end tag */
psz_name
=
xml_ReaderName
(
p_xml_reader
);
if
(
!
psz_name
)
{
msg_Err
(
p_demux
,
"invalid xml stream"
);
goto
end
;
}
/* leave if the current parent node <track> is terminated */
if
(
!
strcmp
(
psz_name
,
psz_element
)
)
{
b_ret
=
true
;
goto
end
;
}
/* there MUST have been a start tag for that element name */
if
(
!
p_handler
||
!
p_handler
->
name
||
strcmp
(
p_handler
->
name
,
psz_name
))
{
msg_Err
(
p_demux
,
"there's no open element left for <%s>"
,
psz_name
);
goto
end
;
}
/* special case: key */
if
(
!
strcmp
(
p_handler
->
name
,
"key"
)
)
{
psz_key
=
strdup
(
psz_value
);
}
/* call the simple handler */
else
if
(
p_handler
->
pf_handler
.
smpl
)
{
p_handler
->
pf_handler
.
smpl
(
p_track
,
psz_key
,
psz_value
);
}
FREE_ATT
();
p_handler
=
NULL
;
break
;
case
XML_READER_TEXT
:
/* simple element content */
free
(
psz_value
);
psz_value
=
xml_ReaderValue
(
p_xml_reader
);
if
(
!
psz_value
)
{
msg_Err
(
p_demux
,
"invalid xml stream"
);
goto
end
;
}
break
;
default:
/* unknown/unexpected xml node */
msg_Err
(
p_demux
,
"unexpected xml node %i"
,
i_node
);
case
XML_READER_ENDELEM
:
/* element end tag */
psz_name
=
xml_ReaderName
(
p_xml_reader
);
if
(
!
psz_name
)
{
msg_Err
(
p_demux
,
"invalid xml stream"
);
goto
end
;
}
/* leave if the current parent node <track> is terminated */
if
(
!
strcmp
(
psz_name
,
psz_element
)
)
{
b_ret
=
true
;
goto
end
;
}
/* there MUST have been a start tag for that element name */
if
(
!
p_handler
||
!
p_handler
->
name
||
strcmp
(
p_handler
->
name
,
psz_name
)
)
{
msg_Err
(
p_demux
,
"there's no open element left for <%s>"
,
psz_name
);
goto
end
;
}
/* special case: key */
if
(
!
strcmp
(
p_handler
->
name
,
"key"
)
)
{
psz_key
=
strdup
(
psz_value
);
}
/* call the simple handler */
else
if
(
p_handler
->
pf_handler
.
smpl
)
{
p_handler
->
pf_handler
.
smpl
(
p_track
,
psz_key
,
psz_value
);
}
FREE_ATT
();
p_handler
=
NULL
;
break
;
default:
/* unknown/unexpected xml node */
msg_Err
(
p_demux
,
"unexpected xml node %i"
,
i_node
);
goto
end
;
}
FREE_NAME
();
}
...
...
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