aboutsummaryrefslogtreecommitdiff
path: root/doc/examples/metadata.c
diff options
context:
space:
mode:
authorJun Zhao2019-04-03 09:13:52 +0800
committerJun Zhao2019-04-07 10:18:42 +0800
commit7c1875143db4573bad2d39f13aadbef7b13628ad (patch)
tree1320bded2bb04faf577b6f1a1e77f542aaa30aae /doc/examples/metadata.c
parentd234ed76330a447a2d01f9e9772259803aa884db (diff)
doc/examples/metadata: fix the example can't dump FLV metadata
fix the example can't dump FLV metadata. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Diffstat (limited to 'doc/examples/metadata.c')
-rw-r--r--doc/examples/metadata.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/examples/metadata.c b/doc/examples/metadata.c
index e330d077a9..b6cfa6bd36 100644
--- a/doc/examples/metadata.c
+++ b/doc/examples/metadata.c
@@ -47,6 +47,11 @@ int main (int argc, char **argv)
if ((ret = avformat_open_input(&fmt_ctx, argv[1], NULL, NULL)))
return ret;
+ if ((ret = avformat_find_stream_info(fmt_ctx, NULL)) < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n");
+ return ret;
+ }
+
while ((tag = av_dict_get(fmt_ctx->metadata, "", tag, AV_DICT_IGNORE_SUFFIX)))
printf("%s=%s\n", tag->key, tag->value);