cleanup: misc

This commit is contained in:
bnnm 2024-07-14 22:09:21 +02:00
parent 9c641c0dc1
commit e607b03284
3 changed files with 15 additions and 13 deletions

View File

@ -642,7 +642,7 @@ static size_t get_table_frame_size(opus_io_data* data, int frame) {
static size_t custom_opus_get_samples(off_t offset, size_t stream_size, STREAMFILE* sf, opus_type_t type) {
size_t num_samples = 0;
off_t end_offset = offset + stream_size;
int packet = 0;
//int packet = 0;
if (end_offset > get_streamfile_size(sf)) {
VGM_LOG("OPUS: wrong end offset found\n");
@ -699,7 +699,7 @@ static size_t custom_opus_get_samples(off_t offset, size_t stream_size, STREAMFI
num_samples += packet_samples;
offset += skip_size + data_size;
packet++;
//packet++;
}
return num_samples;

View File

@ -43,7 +43,7 @@ void vgm_log_set_callback(void* ctx_p, int level, int type, void* callback) {
}
static void log_internal(void* ctx_p, int level, const char* fmt, va_list args) {
char line[255];
char line[256];
int out;
logger_t* ctx = ctx_p;
if (!ctx) ctx = &log_impl;

View File

@ -1,16 +1,18 @@
#ifndef _LIMITS_H
#define _LIMITS_H
#ifndef _VGMSTREAM_LIMITS_H
#define _VGMSTREAM_LIMITS_H
enum {
/* Windows generally only allows 260 chars in path, but other OSs have higher limits, and we handle
* UTF-8 (that typically uses 2-bytes for common non-latin codepages) plus player may append protocols
* to paths, so it should be a bit higher. Most people wouldn't use huge paths though. */
/* Keep path limit within a reasonable stack size.
* Windows generally only allows 260 chars in path, but other OSs have higher limits and we handle
* UTF-8 (that typically uses 2-bytes for common non-latin codepages), plus player may append protocols
* to paths. Most people wouldn't use huge paths though. */
PATH_LIMIT = 4096, /* (256 * 8) * 2 = ~max_path * (other_os+extra) * codepage_bytes */
STREAM_NAME_SIZE = 255,
VGMSTREAM_MAX_CHANNELS = 64,
VGMSTREAM_MIN_SAMPLE_RATE = 300, /* 300 is Wwise min */
VGMSTREAM_MAX_SAMPLE_RATE = 192000, /* found in some FSB5 */
VGMSTREAM_MAX_SUBSONGS = 65535, /* +20000 isn't that uncommon */
STREAM_NAME_SIZE = 256, /* usually small but may need to concat multiple names */
VGMSTREAM_MAX_CHANNELS = 64, /* +40ch multilayers */
VGMSTREAM_MIN_SAMPLE_RATE = 300, /* 300 is Wwise min */
VGMSTREAM_MAX_SAMPLE_RATE = 192000, /* found in some FSB5 */
VGMSTREAM_MAX_SUBSONGS = 65535, /* +20000 isn't that uncommon */
VGMSTREAM_MAX_NUM_SAMPLES = 1000000000, /* no ~5h vgm hopefully */
};