From 376b4acbb28f04eff3892ce81d0f99e20776b66c Mon Sep 17 00:00:00 2001 From: bnnm Date: Sat, 14 Jan 2017 22:25:15 +0100 Subject: [PATCH] Minor func rename (ffmpeg_make_riff_xma2_from_fmt) --- src/coding/coding.h | 2 +- src/coding/ffmpeg_decoder.c | 11 ++++++----- src/meta/gsp_gsb.c | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/coding/coding.h b/src/coding/coding.h index 2fb1fed8..75245e6c 100644 --- a/src/coding/coding.h +++ b/src/coding/coding.h @@ -149,7 +149,7 @@ void seek_ffmpeg(VGMSTREAM *vgmstream, int32_t num_sample); int ffmpeg_make_riff_atrac3(uint8_t * buf, size_t buf_size, size_t sample_count, size_t data_size, int channels, int sample_rate, int block_align, int joint_stereo, int encoder_delay); int ffmpeg_make_riff_xma2(uint8_t * buf, size_t buf_size, size_t sample_count, size_t data_size, int channels, int sample_rate, int block_count, int block_size); -int ffmpeg_make_riff_xma2_from_fmt_be(uint8_t * buf, size_t buf_size, off_t fmt_offset, size_t fmt_size, size_t data_size, STREAMFILE *streamFile); +int ffmpeg_make_riff_xma2_from_fmt(uint8_t * buf, size_t buf_size, off_t fmt_offset, size_t fmt_size, size_t data_size, STREAMFILE *streamFile); #endif diff --git a/src/coding/ffmpeg_decoder.c b/src/coding/ffmpeg_decoder.c index 08db87fa..34102281 100644 --- a/src/coding/ffmpeg_decoder.c +++ b/src/coding/ffmpeg_decoder.c @@ -284,7 +284,6 @@ void seek_ffmpeg(VGMSTREAM *vgmstream, int32_t num_sample) { /* FAKE RIFF HELPERS */ /* ******************************************** */ static int ffmpeg_fmt_chunk_swap_endian(uint8_t * chunk, uint16_t codec); -static int ffmpeg_make_riff_xma2_from_fmt(uint8_t * buf, size_t buf_size, off_t fmt_offset, size_t fmt_size, size_t data_size, STREAMFILE *streamFile, int big_endian); /** * Copies a ATRAC3 riff to buf @@ -415,10 +414,12 @@ int ffmpeg_make_riff_xma2(uint8_t * buf, size_t buf_size, size_t sample_count, s } -int ffmpeg_make_riff_xma2_from_fmt_be(uint8_t * buf, size_t buf_size, off_t fmt_offset, size_t fmt_size, size_t data_size, STREAMFILE *streamFile) { - return ffmpeg_make_riff_xma2_from_fmt(buf, buf_size, fmt_offset, fmt_size, data_size, streamFile, 1); -} -static int ffmpeg_make_riff_xma2_from_fmt(uint8_t * buf, size_t buf_size, off_t fmt_offset, size_t fmt_size, size_t data_size, STREAMFILE *streamFile, int big_endian) { +/** + * Copies a XMA2 riff to buf from a fmt chunk offset + * + * returns number of bytes in buf or -1 when buf is not big enough + */ +int ffmpeg_make_riff_xma2_from_fmt(uint8_t * buf, size_t buf_size, off_t fmt_offset, size_t fmt_size, size_t data_size, STREAMFILE *streamFile, int big_endian) { size_t riff_size = 4+4+ 4 + 4+4+fmt_size + 4+4; uint8_t chunk[100]; diff --git a/src/meta/gsp_gsb.c b/src/meta/gsp_gsb.c index 6502ed57..d4c06d44 100644 --- a/src/meta/gsp_gsb.c +++ b/src/meta/gsp_gsb.c @@ -113,7 +113,7 @@ VGMSTREAM * init_vgmstream_gsp_gsb(STREAMFILE *streamFile) { if (!find_chunk_be(streamFileGSP, 0x584D4558,first_offset,1, &chunk_offset,NULL)) goto fail; /*"XMEX"*/ /* 0x00: fmt0x166 header (BE), 0x34: seek table */ - bytes = ffmpeg_make_riff_xma2_from_fmt_be(buf,200, chunk_offset,0x34, datasize, streamFileGSP); + bytes = ffmpeg_make_riff_xma2_from_fmt(buf,200, chunk_offset,0x34, datasize, streamFileGSP, 1); if (bytes <= 0) goto fail; ffmpeg_data = init_ffmpeg_header_offset(streamFile, buf,bytes, start_offset,datasize);