Commit 150fbce9 authored by gpoirier's avatar gpoirier

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


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@10462 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 1af73c8c
...@@ -390,7 +390,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -390,7 +390,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
{ {
if (!strcmp(name,"WM/AlbumTitle")) get_str16_nolen(pb, value_len, s->album, sizeof(s->album)); 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/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]; char track[8];
get_str16_nolen(pb, value_len, track, sizeof(track)); get_str16_nolen(pb, value_len, track, sizeof(track));
s->track = strtol(track, NULL, 10) + 1; s->track = strtol(track, NULL, 10) + 1;
...@@ -405,7 +405,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -405,7 +405,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
if ((value_type >= 2) && (value_type <= 5)) // boolean or DWORD or QWORD or WORD if ((value_type >= 2) && (value_type <= 5)) // boolean or DWORD or QWORD or WORD
{ {
value_num= get_value(pb, value_type); 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; if (!strcmp(name,"WM/TrackNumber")) s->track = value_num;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment