changeset 2169:a5f318cc9245 libavformat

Add support for track numbers when they are set via strings patch by Patrice Bensoussan: patrice bensoussan free fr
author benoit
date Fri, 15 Jun 2007 09:10:19 +0000
parents d095666dedf3
children 4452d75a9298
files asf.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/asf.c	Thu Jun 14 18:14:35 2007 +0000
+++ b/asf.c	Fri Jun 15 09:10:19 2007 +0000
@@ -389,6 +389,16 @@
                         {
                                 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")) {
+                                    char track[8];
+                                    get_str16_nolen(pb, value_len, track, sizeof(track));
+                                    s->track = strtol(track, NULL, 10) + 1;
+                                }
+                                else if(!strcmp(name,"WM/TrackNumber")) {
+                                    char track[8];
+                                    get_str16_nolen(pb, value_len, track, sizeof(track));
+                                    s->track = strtol(track, NULL, 10);
+                                }
                                 else url_fskip(pb, value_len);
                         }
                         if ((value_type >= 2) && (value_type <= 5)) // boolean or DWORD or QWORD or WORD