git.videolan.org
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
58677d7
)
ffprobe: directly use va args in print fmt callbacks.
author
Clément Bœsch
<ubitux@gmail.com>
Thu, 1 Sep 2011 20:09:15 +0000
(22:09 +0200)
committer
Clément Bœsch
<ubitux@gmail.com>
Thu, 1 Sep 2011 20:15:06 +0000
(22:15 +0200)
ffprobe.c
patch
|
blob
|
history
diff --git
a/ffprobe.c
b/ffprobe.c
index
ad125ce
..
2748224
100644
(file)
--- a/
ffprobe.c
+++ b/
ffprobe.c
@@
-132,7
+132,7
@@
struct writer {
const char *header, *footer;
void (*print_header)(const char *);
void (*print_footer)(const char *);
const char *header, *footer;
void (*print_header)(const char *);
void (*print_footer)(const char *);
- void (*print_fmt_f)(const char *, const char *,
va_list ap
);
+ void (*print_fmt_f)(const char *, const char *,
...
);
void (*print_int_f)(const char *, int);
void (*show_tags)(struct writer *w, AVDictionary *dict);
};
void (*print_int_f)(const char *, int);
void (*show_tags)(struct writer *w, AVDictionary *dict);
};
@@
-145,10
+145,13
@@
static void default_print_header(const char *section)
printf("[%s]\n", section);
}
printf("[%s]\n", section);
}
-static void default_print_fmt(const char *key, const char *fmt,
va_list ap
)
+static void default_print_fmt(const char *key, const char *fmt,
...
)
{
{
+ va_list ap;
+ va_start(ap, fmt);
printf("%s=", key);
vprintf(fmt, ap);
printf("%s=", key);
vprintf(fmt, ap);
+ va_end(ap);
}
static void default_print_int(const char *key, int value)
}
static void default_print_int(const char *key, int value)
@@
-164,19
+167,11
@@
static void default_print_footer(const char *section)
/* Print helpers */
/* Print helpers */
-static void print_vfmt0(struct writer *w, const char *key, const char *fmt, ...)
-{
- va_list ap;
- va_start(ap, fmt);
- w->print_fmt_f(key, fmt, ap);
- va_end(ap);
-}
-
-#define print_fmt0(k, f, a...) print_vfmt0(w, k, f, ##a)
+#define print_fmt0(k, f, a...) w->print_fmt_f(k, f, ##a)
#define print_fmt( k, f, a...) do { \
if (w->item_sep) \
printf("%s", w->item_sep); \
#define print_fmt( k, f, a...) do { \
if (w->item_sep) \
printf("%s", w->item_sep); \
-
print_vfmt0(w,
k, f, ##a); \
+
w->print_fmt_f(
k, f, ##a); \
} while (0)
#define print_int0(k, v) w->print_int_f(k, v)
} while (0)
#define print_int0(k, v) w->print_int_f(k, v)