[FFmpeg-devel] [PATCH]Ignore or try to fix "WM/Track" in asf

Carl Eugen Hoyos cehoyos at ag.or.at
Sat Dec 31 19:08:30 CET 2011


Hi!

Attached patch fixes ticket #825 for me.
An alternative would be to always ignore "WM/Track" (which is deprecated and 
0-based).

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 3f733f7..92a72e9 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -176,6 +176,12 @@ static void get_tag(AVFormatContext *s, const char *key, int type, int len)
         av_log(s, AV_LOG_DEBUG, "Unsupported value type %d in tag %s.\n", type, key);
         goto finish;
     }
+    if (!memcmp(key, "WM/Track\0", 9))
+        if (av_dict_get(s->metadata, "WM/TrackNumber", NULL, 0)) {
+            goto finish;
+        } else {
+            snprintf(value, 2 * len + 1, "%ld", strtol(value, NULL, 10) + 1);
+        }
     if (*value)
         av_dict_set(&s->metadata, key, value, 0);
 finish:


More information about the ffmpeg-devel mailing list