Lower parse priority of raw metas so TXTH has a chance to go first

This commit is contained in:
bnnm 2018-08-22 20:39:31 +02:00
parent 785741e7e1
commit dcbc7e5b9b
5 changed files with 13 additions and 14 deletions

View File

@ -697,7 +697,7 @@ static const meta_info meta_info_list[] = {
{meta_DSP_STM, "Nintendo STM header"},
{meta_PS2_EXST, "Sony EXST header"},
{meta_PS2_SVAG, "Konami SVAG header"},
{meta_PS2_MIB, "Headerless/MIB PS-ADPCM raw header"},
{meta_PS_HEADERLESS, "Headerless PS-ADPCM raw header"},
{meta_PS2_MIB_MIH, "Sony MultiStream MIH+MIB header"},
{meta_DSP_MPDSP, "Single DSP header stereo by .mpdsp extension"},
{meta_PS2_MIC, "assume KOEI MIC file by .mic extension"},

View File

@ -59,7 +59,7 @@ VGMSTREAM * init_vgmstream_ps2_exst(STREAMFILE *streamFile);
VGMSTREAM * init_vgmstream_ps2_svag(STREAMFILE *streamFile);
VGMSTREAM * init_vgmstream_ps2_mib(STREAMFILE *streamFile);
VGMSTREAM * init_vgmstream_ps_headerless(STREAMFILE *streamFile);
VGMSTREAM * init_vgmstream_mib_mih(STREAMFILE *streamFile);

View File

@ -7,7 +7,7 @@ static int check_psadpcm(STREAMFILE *streamFile);
/* headerless PS-ADPCM - from Katamary Damacy (PS2), Air (PS2), Aladdin: Nasira's Revenge (PS1)
* (guesses interleave and channels by testing data and using the file extension, and finds
* loops in PS-ADPCM flags; this is a crutch for convenience, consider using GENH/TXTH instead). */
VGMSTREAM * init_vgmstream_ps2_mib(STREAMFILE *streamFile) {
VGMSTREAM * init_vgmstream_ps_headerless(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
off_t start_offset = 0x00;
char filename[PATH_LIMIT];
@ -275,12 +275,10 @@ VGMSTREAM * init_vgmstream_ps2_mib(STREAMFILE *streamFile) {
vgmstream->loop_end_sample-=(emptySamples*channel_count);
}
vgmstream->meta_type = meta_PS2_MIB;
//if (vgmstream->loop_end_sample) goto fail;
vgmstream->meta_type = meta_PS_HEADERLESS;
if (!vgmstream_open_stream(vgmstream,streamFile,start_offset))
goto fail;
return vgmstream;
fail:

View File

@ -41,16 +41,13 @@ VGMSTREAM * (*init_vgmstream_functions[])(STREAMFILE *streamFile) = {
init_vgmstream_cdxa,
init_vgmstream_ps2_rxws,
init_vgmstream_ps2_rxw,
init_vgmstream_ps2_int,
init_vgmstream_ngc_dsp_stm,
init_vgmstream_ps2_exst,
init_vgmstream_ps2_svag,
init_vgmstream_mib_mih,
init_vgmstream_ps2_mib,
init_vgmstream_ngc_mpdsp,
init_vgmstream_ps2_mic,
init_vgmstream_ngc_dsp_std_int,
init_vgmstream_raw,
init_vgmstream_vag,
init_vgmstream_psx_gms,
init_vgmstream_ps2_ild,
@ -426,9 +423,13 @@ VGMSTREAM * (*init_vgmstream_functions[])(STREAMFILE *streamFile) = {
init_vgmstream_nus3bank,
init_vgmstream_scd_sscf,
init_vgmstream_txth, /* should go at the end (lower priority) */
/* lowest priority metas (TXTH should go before raw formats) */
init_vgmstream_txth, /* proper parsers should supersede TXTH, once added */
init_vgmstream_ps2_int, /* .int raw PS-ADPCM */
init_vgmstream_ps_headerless, /* tries to detect a bunch of PS-ADPCM formats */
init_vgmstream_raw, /* .raw PCM */
#ifdef VGM_USE_FFMPEG
init_vgmstream_ffmpeg, /* should go at the end (lowest priority) */
init_vgmstream_ffmpeg, /* may play anything incorrectly, since FFmpeg doesn't check extensions */
#endif
};
@ -479,7 +480,7 @@ static VGMSTREAM * init_vgmstream_internal(STREAMFILE *streamFile) {
(vgmstream->meta_type == meta_GENH) ||
(vgmstream->meta_type == meta_TXTH) ||
(vgmstream->meta_type == meta_KRAW) ||
(vgmstream->meta_type == meta_PS2_MIB) ||
(vgmstream->meta_type == meta_PS_HEADERLESS) ||
(vgmstream->meta_type == meta_NGC_LPS) ||
(vgmstream->meta_type == meta_DSP_YGO) ||
(vgmstream->meta_type == meta_DSP_AGSC) ||

View File

@ -331,7 +331,7 @@ typedef enum {
meta_PS2_RAW, /* RAW Interleaved Format */
meta_PS2_EXST, /* Shadow of Colossus EXST */
meta_PS2_SVAG, /* Konami SVAG */
meta_PS2_MIB, /* MIB File */
meta_PS_HEADERLESS, /* headerless PS-ADPCM */
meta_PS2_MIB_MIH, /* MIB File + MIH Header*/
meta_PS2_MIC, /* KOEI MIC File */
meta_PS2_VAGi, /* VAGi Interleaved File */