From 383b25fd5478e7760bec0d87ed95ff862398cb46 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 1 Jul 2010 15:03:21 +0000 Subject: [PATCH] fix warning in ff_metadata_mux_compat() warning: the address of 'number' will always evaluate as 'true' patch by Eli Friedman eli _dot_ friedman _at_ gmail _dot_ com Originally committed as revision 23936 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/metadata_compat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavformat/metadata_compat.c b/libavformat/metadata_compat.c index ac99c05..26d2224 100644 --- a/libavformat/metadata_compat.c +++ b/libavformat/metadata_compat.c @@ -108,10 +108,11 @@ void ff_metadata_demux_compat(AVFormatContext *ctx) #define FILL_METADATA(s, key, value) { \ - if (value && *value && !av_metadata_get(s->metadata, #key, NULL, 0)) \ + if (!av_metadata_get(s->metadata, #key, NULL, 0)) \ av_metadata_set2(&s->metadata, #key, value, 0); \ } -#define FILL_METADATA_STR(s, key) FILL_METADATA(s, key, s->key) +#define FILL_METADATA_STR(s, key) { \ + if (s->key && *s->key) FILL_METADATA(s, key, s->key); } #define FILL_METADATA_INT(s, key) { \ char number[10]; \ snprintf(number, sizeof(number), "%d", s->key); \ -- 2.7.4