mirror of
https://github.com/owntone/owntone-server.git
synced 2025-04-22 11:35:43 -04:00
xing header alignment problems fix, hat tip to Paul Forgey
This commit is contained in:
parent
fc2c656317
commit
cb42785a36
5
CREDITS
5
CREDITS
@ -102,3 +102,8 @@ Phil Packer
|
|||||||
Diego Penneno
|
Diego Penneno
|
||||||
* Patches for multiple PID files to facilitate gentoo init scripts
|
* Patches for multiple PID files to facilitate gentoo init scripts
|
||||||
|
|
||||||
|
Paul Forgey
|
||||||
|
* Fixes for alignment problems in XING header parsing
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -921,15 +921,19 @@ int scan_mp3_get_mp3fileinfo(char *file, MP3FILE *pmp3) {
|
|||||||
/* now check for an XING header */
|
/* now check for an XING header */
|
||||||
if(strncasecmp((char*)&buffer[index+fi.xing_offset+4],"XING",4) == 0) {
|
if(strncasecmp((char*)&buffer[index+fi.xing_offset+4],"XING",4) == 0) {
|
||||||
DPRINTF(E_DBG,L_SCAN,"Found Xing header\n");
|
DPRINTF(E_DBG,L_SCAN,"Found Xing header\n");
|
||||||
xing_flags=*((int*)&buffer[index+fi.xing_offset+4+4]);
|
xing_flags = buffer[index+fi.xing_offset+4+4] << 24 |
|
||||||
xing_flags=ntohs(xing_flags);
|
buffer[index+fi.xing_offset+4+5] << 16 |
|
||||||
|
buffer[index+fi.xing_offset+4+6] << 8 |
|
||||||
|
buffer[index+fi.xing_offset+4+7];
|
||||||
|
|
||||||
DPRINTF(E_DBG,L_SCAN,"Xing Flags: %02X\n",xing_flags);
|
DPRINTF(E_DBG,L_SCAN,"Xing Flags: %02X\n",xing_flags);
|
||||||
|
|
||||||
if(xing_flags & 0x1) {
|
if(xing_flags & 0x1) {
|
||||||
/* Frames field is valid... */
|
/* Frames field is valid... */
|
||||||
fi.number_of_frames=*((int*)&buffer[index+fi.xing_offset+4+8]);
|
fi.number_of_frames=buffer[index+fi.xing_offset+4+8] << 24 |
|
||||||
fi.number_of_frames=ntohs(fi.number_of_frames);
|
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