summaryrefslogtreecommitdiff
path: root/ffprobe.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2012-05-10 01:28:07 +0200
committerStefano Sabatini <stefasab@gmail.com>2012-05-14 12:59:51 +0200
commit3946187d60b87163b17cc5ca6d63ce0ddf4111af (patch)
treeb11d89e89e789bb439fc0f48384b5c69be5065e7 /ffprobe.c
parentf48f03a400ac97a18db59387250d5631a6b329a7 (diff)
ffprobe: add "nokey" option to default writer
Help simplifying parsing in certain cases.
Diffstat (limited to 'ffprobe.c')
-rw-r--r--ffprobe.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/ffprobe.c b/ffprobe.c
index 5a8c9e8b65..d3cad33f06 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -403,6 +403,7 @@ fail:
typedef struct DefaultContext {
const AVClass *class;
+ int nokey;
int noprint_wrappers;
} DefaultContext;
@@ -411,6 +412,8 @@ typedef struct DefaultContext {
static const AVOption default_options[] = {
{ "noprint_wrappers", "do not print headers and footers", OFFSET(noprint_wrappers), AV_OPT_TYPE_INT, {.dbl=0}, 0, 1 },
{ "nw", "do not print headers and footers", OFFSET(noprint_wrappers), AV_OPT_TYPE_INT, {.dbl=0}, 0, 1 },
+ { "nokey", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_INT, {.dbl=0}, 0, 1 },
+ { "nk", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_INT, {.dbl=0}, 0, 1 },
{NULL},
};
@@ -490,12 +493,19 @@ static void default_print_section_footer(WriterContext *wctx, const char *sectio
static void default_print_str(WriterContext *wctx, const char *key, const char *value)
{
- printf("%s=%s\n", key, value);
+ DefaultContext *def = wctx->priv;
+ if (!def->nokey)
+ printf("%s=", key);
+ printf("%s\n", value);
}
static void default_print_int(WriterContext *wctx, const char *key, long long int value)
{
- printf("%s=%lld\n", key, value);
+ DefaultContext *def = wctx->priv;
+
+ if (!def->nokey)
+ printf("%s=", key);
+ printf("%lld\n", value);
}
static void default_show_tags(WriterContext *wctx, AVDictionary *dict)