OSDN Git Service

dump_metadata: Fix 0xd in metadata
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 19 Jun 2011 18:32:37 +0000 (20:32 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 19 Jun 2011 23:58:18 +0000 (01:58 +0200)
Fixed ticket245

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/utils.c

index 4fc74fa..cd90480 100644 (file)
@@ -3329,8 +3329,13 @@ static void dump_metadata(void *ctx, AVDictionary *m, const char *indent)
 
         av_log(ctx, AV_LOG_INFO, "%sMetadata:\n", indent);
         while((tag=av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX))) {
-            if(strcmp("language", tag->key))
-                av_log(ctx, AV_LOG_INFO, "%s  %-16s: %s\n", indent, tag->key, tag->value);
+            if(strcmp("language", tag->key)){
+                char tmp[256];
+                int i;
+                av_strlcpy(tmp, tag->value, sizeof(tmp));
+                for(i=0; i<strlen(tmp); i++) if(tmp[i]==0xd) tmp[i]=' ';
+                av_log(ctx, AV_LOG_INFO, "%s  %-16s: %s\n", indent, tag->key, tmp);
+            }
         }
     }
 }