CRLF to LF

This commit is contained in:
bnnm 2020-01-12 12:37:17 +01:00
parent 4afa42bee6
commit 9fdf2dbf1a

View File

@ -1,69 +1,69 @@
#include "meta.h" #include "meta.h"
#include "../coding/coding.h" #include "../coding/coding.h"
/* PASX - from SoulCalibur II HD (X360) */ /* PASX - from SoulCalibur II HD (X360) */
VGMSTREAM * init_vgmstream_x360_pasx(STREAMFILE *streamFile) { VGMSTREAM * init_vgmstream_x360_pasx(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL; VGMSTREAM * vgmstream = NULL;
off_t start_offset, chunk_offset; off_t start_offset, chunk_offset;
size_t data_size, chunk_size; size_t data_size, chunk_size;
int loop_flag, channel_count, sample_rate; int loop_flag, channel_count, sample_rate;
int num_samples, loop_start_sample, loop_end_sample; int num_samples, loop_start_sample, loop_end_sample;
/* checks */ /* checks */
if ( !check_extensions(streamFile,"past")) if ( !check_extensions(streamFile,"past"))
goto fail; goto fail;
if (read_32bitBE(0x00,streamFile) != 0x50415358) /* "PASX" */ if (read_32bitBE(0x00,streamFile) != 0x50415358) /* "PASX" */
goto fail; goto fail;
/* custom header with a "fmt " data chunk inside */ /* custom header with a "fmt " data chunk inside */
chunk_size = read_32bitBE(0x08,streamFile); chunk_size = read_32bitBE(0x08,streamFile);
data_size = read_32bitBE(0x0c,streamFile); data_size = read_32bitBE(0x0c,streamFile);
chunk_offset = read_32bitBE(0x10,streamFile); /* 0x14: fmt offset end */ chunk_offset = read_32bitBE(0x10,streamFile); /* 0x14: fmt offset end */
start_offset = read_32bitBE(0x18,streamFile); start_offset = read_32bitBE(0x18,streamFile);
channel_count = read_16bitBE(chunk_offset+0x02,streamFile); channel_count = read_16bitBE(chunk_offset+0x02,streamFile);
sample_rate = read_32bitBE(chunk_offset+0x04,streamFile); sample_rate = read_32bitBE(chunk_offset+0x04,streamFile);
xma2_parse_fmt_chunk_extra(streamFile, chunk_offset, &loop_flag, &num_samples, &loop_start_sample, &loop_end_sample, 1); xma2_parse_fmt_chunk_extra(streamFile, chunk_offset, &loop_flag, &num_samples, &loop_start_sample, &loop_end_sample, 1);
/* build the VGMSTREAM */ /* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag); vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail; if (!vgmstream) goto fail;
vgmstream->sample_rate = sample_rate; vgmstream->sample_rate = sample_rate;
vgmstream->num_samples = num_samples; vgmstream->num_samples = num_samples;
vgmstream->loop_start_sample = loop_start_sample; vgmstream->loop_start_sample = loop_start_sample;
vgmstream->loop_end_sample = loop_end_sample; vgmstream->loop_end_sample = loop_end_sample;
vgmstream->meta_type = meta_X360_PASX; vgmstream->meta_type = meta_X360_PASX;
#ifdef VGM_USE_FFMPEG #ifdef VGM_USE_FFMPEG
{ {
uint8_t buf[0x100]; uint8_t buf[0x100];
size_t bytes; size_t bytes;
bytes = ffmpeg_make_riff_xma_from_fmt_chunk(buf,0x100, chunk_offset,chunk_size, data_size, streamFile, 1); bytes = ffmpeg_make_riff_xma_from_fmt_chunk(buf,0x100, chunk_offset,chunk_size, data_size, streamFile, 1);
if (bytes <= 0) goto fail; if (bytes <= 0) goto fail;
vgmstream->codec_data = init_ffmpeg_header_offset(streamFile, buf,bytes, start_offset,data_size); vgmstream->codec_data = init_ffmpeg_header_offset(streamFile, buf,bytes, start_offset,data_size);
if ( !vgmstream->codec_data ) goto fail; if ( !vgmstream->codec_data ) goto fail;
vgmstream->coding_type = coding_FFmpeg; vgmstream->coding_type = coding_FFmpeg;
vgmstream->layout_type = layout_none; vgmstream->layout_type = layout_none;
xma_fix_raw_samples(vgmstream, streamFile, start_offset, data_size, chunk_offset, 1,1); xma_fix_raw_samples(vgmstream, streamFile, start_offset, data_size, chunk_offset, 1,1);
} }
#else #else
goto fail; goto fail;
#endif #endif
/* open the file for reading */ /* open the file for reading */
if ( !vgmstream_open_stream(vgmstream, streamFile, start_offset) ) if ( !vgmstream_open_stream(vgmstream, streamFile, start_offset) )
goto fail; goto fail;
return vgmstream; return vgmstream;
fail: fail:
close_vgmstream(vgmstream); close_vgmstream(vgmstream);
return NULL; return NULL;
} }