Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
ffmpeg2theora
Commits
26bb7747
Commit
26bb7747
authored
Dec 04, 2011
by
Jan Gerber
Browse files
output metadata
parent
d2bf7ccf
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/avinfo.c
View file @
26bb7747
...
...
@@ -386,12 +386,11 @@ static int utf8_validate (char *s, int n) {
error:
return
i
==
n
;
}
void
json_metadata
(
FILE
*
output
,
const
AVFormatContext
*
av
)
int
_json_metadata
(
FILE
*
output
,
AVDictionary
*
m
,
int
first
,
int
indent
)
{
int
first
=
1
,
indent
=
2
;
int
i
=
0
;
AVDictionaryEntry
*
tag
=
NULL
;
while
((
tag
=
av_dict_get
(
av
->
metadata
,
""
,
tag
,
AV_METADATA_IGNORE_SUFFIX
)))
{
while
((
tag
=
av_dict_get
(
m
,
""
,
tag
,
AV_METADATA_IGNORE_SUFFIX
)))
{
if
(
strlen
(
tag
->
value
)
&&
utf8_validate
(
tag
->
value
,
strlen
(
tag
->
value
)))
{
if
(
first
)
{
first
=
0
;
...
...
@@ -405,6 +404,17 @@ void json_metadata(FILE *output, const AVFormatContext *av)
json_add_key_value
(
output
,
tag
->
key
,
tag
->
value
,
JSON_STRING
,
1
,
indent
);
}
}
return
first
;
}
void
json_metadata
(
FILE
*
output
,
const
AVFormatContext
*
av
)
{
int
first
=
1
,
indent
=
2
,
i
=
0
;
first
=
_json_metadata
(
output
,
av
->
metadata
,
first
,
indent
);
for
(
i
=
0
;
i
<
av
->
nb_streams
;
i
++
)
{
first
=
_json_metadata
(
output
,
av
->
streams
[
i
]
->
metadata
,
first
,
indent
);
}
if
(
!
first
)
{
do_indent
(
output
,
1
);
fprintf
(
output
,
"},
\n
"
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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