changeset 2538:0d837f926052 libavformat

Improve track number decoding for some WMA files patch by Patrice Bensoussan %patrice P bensoussan A free P fr% Original thread: Date: Sep 9, 2007 12:33 PM Subject: [FFmpeg-devel] [PATCH] Improve track number decoding for some WMA files
author gpoirier
date Sun, 09 Sep 2007 17:54:26 +0000
parents 46fc89be5b52
children ba933dfa4833
files asf.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/asf.c	Sun Sep 09 09:21:14 2007 +0000
+++ b/asf.c	Sun Sep 09 17:54:26 2007 +0000
@@ -390,7 +390,7 @@
                         {
                                 if     (!strcmp(name,"WM/AlbumTitle")) get_str16_nolen(pb, value_len, s->album, sizeof(s->album));
                                 else if(!strcmp(name,"WM/Genre"     )) get_str16_nolen(pb, value_len, s->genre, sizeof(s->genre));
-                                else if(!strcmp(name,"WM/Track")) {
+                                else if(!strcmp(name,"WM/Track") && s->track == 0) {
                                     char track[8];
                                     get_str16_nolen(pb, value_len, track, sizeof(track));
                                     s->track = strtol(track, NULL, 10) + 1;
@@ -405,7 +405,7 @@
                         if ((value_type >= 2) && (value_type <= 5)) // boolean or DWORD or QWORD or WORD
                         {
                                 value_num= get_value(pb, value_type);
-                                if (!strcmp(name,"WM/Track"      )) s->track = value_num + 1;
+                                if (!strcmp(name,"WM/Track"      ) && s->track == 0) s->track = value_num + 1;
                                 if (!strcmp(name,"WM/TrackNumber")) s->track = value_num;
                         }
                 }