diff --git a/src/formats.c b/src/formats.c index ea188a12..c22d884c 100644 --- a/src/formats.c +++ b/src/formats.c @@ -752,7 +752,7 @@ static const meta_info meta_info_list[] = { {meta_RWAV, "Nintendo RWAV header"}, {meta_CWAV, "Nintendo CWAV header"}, {meta_FWAV, "Nintendo FWAV header"}, - {meta_XA, "Sony XA RIFF header"}, + {meta_XA, "Sony XA header"}, {meta_PS2_RXWS, "Sony RXWS header"}, {meta_PS2_RAW, ".int PCM raw header"}, {meta_PS2_OMU, "Alter Echo OMU Header"}, diff --git a/src/meta/xa.c b/src/meta/xa.c index 35b26c60..5c919dac 100644 --- a/src/meta/xa.c +++ b/src/meta/xa.c @@ -2,7 +2,7 @@ #include "../layout/layout.h" #include "../coding/coding.h" -/* CD-XA - from Sony PS1 CDs */ +/* CD-XA - from Sony PS1 and Philips CD-i CD audio */ VGMSTREAM * init_vgmstream_xa(STREAMFILE *streamFile) { VGMSTREAM * vgmstream = NULL; off_t start_offset; @@ -10,6 +10,7 @@ VGMSTREAM * init_vgmstream_xa(STREAMFILE *streamFile) { int is_blocked; size_t file_size = get_streamfile_size(streamFile); + /* checks * .xa: common, .str: sometimes (mainly videos) * .adp: Phantasy Star Collection (SAT) raw XA */ @@ -53,7 +54,7 @@ VGMSTREAM * init_vgmstream_xa(STREAMFILE *streamFile) { for (i = 0; i < (sector_size/block_size); i++) { /* XA headers checks: filter indexes should be 0..3, and shifts 0..C */ for (j = 0; j < 16; j++) { - uint8_t header = (uint8_t)read_8bit(test_offset + i, streamFile); + uint8_t header = (uint8_t)read_8bit(test_offset + j, streamFile); if (((header >> 4) & 0xF) > 0x03) goto fail; if (((header >> 0) & 0xF) > 0x0c)