* Fix big-endian issue with XING header parsing.
This commit is contained in:
parent
6325789eda
commit
acf6f16d02
@ -729,15 +729,19 @@ _get_mp3fileinfo(char *file, struct song_metadata *psong)
|
||||
psong->vbr_scale = -1;
|
||||
if(!strncasecmp((char*)&buffer[index + fi.xing_offset + 4], "XING", 4))
|
||||
{
|
||||
xing_flags = *((int*)&buffer[index + fi.xing_offset + 4 + 4]);
|
||||
xing_flags = ntohs(xing_flags);
|
||||
xing_flags = buffer[index+fi.xing_offset+4+4] << 24 |
|
||||
buffer[index+fi.xing_offset+4+5] << 16 |
|
||||
buffer[index+fi.xing_offset+4+6] << 8 |
|
||||
buffer[index+fi.xing_offset+4+7];
|
||||
psong->vbr_scale = 78;
|
||||
|
||||
if(xing_flags & 0x1)
|
||||
{
|
||||
/* Frames field is valid... */
|
||||
fi.number_of_frames = *((int*)&buffer[index + fi.xing_offset + 4 + 8]);
|
||||
fi.number_of_frames = ntohs(fi.number_of_frames);
|
||||
fi.number_of_frames = buffer[index+fi.xing_offset+4+8] << 24 |
|
||||
buffer[index+fi.xing_offset+4+9] << 16 |
|
||||
buffer[index+fi.xing_offset+4+10] << 8 |
|
||||
buffer[index+fi.xing_offset+4+11];
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user