summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-05-07 22:01:15 +0200
committerAnton Khirnov <anton@khirnov.net>2012-05-16 18:35:05 +0200
commitd894752387fe0d79afb752d1437ca4e98a47cf9f (patch)
tree83c2bf6e6fdf9ad761727d7696a0fd09f0ca1707
parent6ce51a9b392aaf647c4cdfd149fff1af5259a6fd (diff)
avprobe: don't print format entry name when only one was requested
This is easier to parse with automated tools.
-rw-r--r--avprobe.c6
-rw-r--r--tests/fate/probe.mak8
2 files changed, 9 insertions, 5 deletions
diff --git a/avprobe.c b/avprobe.c
index 0233ea9e39..6182875d91 100644
--- a/avprobe.c
+++ b/avprobe.c
@@ -34,6 +34,7 @@ const int program_birth_year = 2007;
static int do_show_format = 0;
static AVDictionary *fmt_entries_to_show = NULL;
+static int nb_fmt_entries_to_show;
static int do_show_packets = 0;
static int do_show_streams = 0;
@@ -269,7 +270,9 @@ static void print_format_entry(const char *tag,
printf("%s\n", val);
}
} else if (tag && av_dict_get(fmt_entries_to_show, tag, NULL, 0)) {
- printf("%s=%s\n", tag, val);
+ if (nb_fmt_entries_to_show > 1)
+ printf("%s=", tag);
+ printf("%s\n", val);
}
}
@@ -408,6 +411,7 @@ static int opt_format(const char *opt, const char *arg)
static int opt_show_format_entry(const char *opt, const char *arg)
{
do_show_format = 1;
+ nb_fmt_entries_to_show++;
av_dict_set(&fmt_entries_to_show, arg, "", 0);
return 0;
}
diff --git a/tests/fate/probe.mak b/tests/fate/probe.mak
index 77e9943552..ae50704770 100644
--- a/tests/fate/probe.mak
+++ b/tests/fate/probe.mak
@@ -1,14 +1,14 @@
FATE_PROBE_FORMAT += fate-probe-format-roundup997
-fate-probe-format-roundup997: REF = format_name=mpeg
+fate-probe-format-roundup997: REF = mpeg
FATE_PROBE_FORMAT += fate-probe-format-roundup1383
-fate-probe-format-roundup1383: REF = format_name=mp3
+fate-probe-format-roundup1383: REF = mp3
FATE_PROBE_FORMAT += fate-probe-format-roundup1414
-fate-probe-format-roundup1414: REF = format_name=mpeg
+fate-probe-format-roundup1414: REF = mpeg
FATE_PROBE_FORMAT += fate-probe-format-roundup2015
-fate-probe-format-roundup2015: REF = format_name=dv
+fate-probe-format-roundup2015: REF = dv
FATE-$(CONFIG_AVPROBE) += $(FATE_PROBE_FORMAT)
fate-probe-format: $(FATE_PROBE_FORMAT)