Mercurial > libavformat.hg
changeset 6206:8515b7b4fe87 libavformat
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
author | aurel |
---|---|
date | Thu, 01 Jul 2010 15:03:21 +0000 |
parents | 1327f1008940 |
children | ab29c8ff40d9 |
files | metadata_compat.c |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/metadata_compat.c Thu Jul 01 14:49:32 2010 +0000 +++ b/metadata_compat.c Thu Jul 01 15:03:21 2010 +0000 @@ -108,10 +108,11 @@ #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); \