mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
Reorder structs, alignment
This commit is contained in:
parent
f09df7c6e3
commit
f48dc0ff5b
@ -77,11 +77,11 @@ enum audio_mixer_state
|
|||||||
|
|
||||||
typedef struct audio_statistics
|
typedef struct audio_statistics
|
||||||
{
|
{
|
||||||
|
unsigned samples;
|
||||||
float average_buffer_saturation;
|
float average_buffer_saturation;
|
||||||
float std_deviation_percentage;
|
float std_deviation_percentage;
|
||||||
float close_to_underrun;
|
float close_to_underrun;
|
||||||
float close_to_blocking;
|
float close_to_blocking;
|
||||||
unsigned samples;
|
|
||||||
} audio_statistics_t;
|
} audio_statistics_t;
|
||||||
|
|
||||||
RETRO_END_DECLS
|
RETRO_END_DECLS
|
||||||
|
@ -49,10 +49,9 @@
|
|||||||
|
|
||||||
typedef struct rarch_CC_resampler
|
typedef struct rarch_CC_resampler
|
||||||
{
|
{
|
||||||
audio_frame_float_t buffer[4];
|
|
||||||
|
|
||||||
float distance;
|
|
||||||
void (*process)(void *re, struct resampler_data *data);
|
void (*process)(void *re, struct resampler_data *data);
|
||||||
|
audio_frame_float_t buffer[4];
|
||||||
|
float distance;
|
||||||
} rarch_CC_resampler_t;
|
} rarch_CC_resampler_t;
|
||||||
|
|
||||||
#ifdef _MIPS_ARCH_ALLEGREX
|
#ifdef _MIPS_ARCH_ALLEGREX
|
||||||
|
@ -73,16 +73,16 @@ struct audio_mixer_sound
|
|||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
/* wav */
|
/* wav */
|
||||||
unsigned frames;
|
|
||||||
const float* pcm;
|
const float* pcm;
|
||||||
|
unsigned frames;
|
||||||
} wav;
|
} wav;
|
||||||
|
|
||||||
#ifdef HAVE_STB_VORBIS
|
#ifdef HAVE_STB_VORBIS
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
/* ogg */
|
/* ogg */
|
||||||
unsigned size;
|
|
||||||
const void* data;
|
const void* data;
|
||||||
|
unsigned size;
|
||||||
} ogg;
|
} ogg;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -90,8 +90,8 @@ struct audio_mixer_sound
|
|||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
/* flac */
|
/* flac */
|
||||||
unsigned size;
|
|
||||||
const void* data;
|
const void* data;
|
||||||
|
unsigned size;
|
||||||
} flac;
|
} flac;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -99,8 +99,8 @@ struct audio_mixer_sound
|
|||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
/* mp */
|
/* mp */
|
||||||
unsigned size;
|
|
||||||
const void* data;
|
const void* data;
|
||||||
|
unsigned size;
|
||||||
} mp3;
|
} mp3;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -108,8 +108,8 @@ struct audio_mixer_sound
|
|||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
/* mod/s3m/xm */
|
/* mod/s3m/xm */
|
||||||
unsigned size;
|
|
||||||
const void* data;
|
const void* data;
|
||||||
|
unsigned size;
|
||||||
} mod;
|
} mod;
|
||||||
#endif
|
#endif
|
||||||
} types;
|
} types;
|
||||||
@ -117,12 +117,6 @@ struct audio_mixer_sound
|
|||||||
|
|
||||||
struct audio_mixer_voice
|
struct audio_mixer_voice
|
||||||
{
|
{
|
||||||
bool repeat;
|
|
||||||
unsigned type;
|
|
||||||
float volume;
|
|
||||||
audio_mixer_sound_t *sound;
|
|
||||||
audio_mixer_stop_cb_t stop_cb;
|
|
||||||
|
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
struct
|
struct
|
||||||
@ -133,61 +127,67 @@ struct audio_mixer_voice
|
|||||||
#ifdef HAVE_STB_VORBIS
|
#ifdef HAVE_STB_VORBIS
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
unsigned position;
|
|
||||||
unsigned samples;
|
|
||||||
unsigned buf_samples;
|
|
||||||
float* buffer;
|
|
||||||
float ratio;
|
|
||||||
stb_vorbis *stream;
|
stb_vorbis *stream;
|
||||||
void *resampler_data;
|
void *resampler_data;
|
||||||
const retro_resampler_t *resampler;
|
const retro_resampler_t *resampler;
|
||||||
|
float *buffer;
|
||||||
|
unsigned position;
|
||||||
|
unsigned samples;
|
||||||
|
unsigned buf_samples;
|
||||||
|
float ratio;
|
||||||
} ogg;
|
} ogg;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_DR_FLAC
|
#ifdef HAVE_DR_FLAC
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
unsigned position;
|
|
||||||
unsigned samples;
|
|
||||||
unsigned buf_samples;
|
|
||||||
float* buffer;
|
float* buffer;
|
||||||
float ratio;
|
|
||||||
drflac *stream;
|
drflac *stream;
|
||||||
void *resampler_data;
|
void *resampler_data;
|
||||||
const retro_resampler_t *resampler;
|
const retro_resampler_t *resampler;
|
||||||
|
unsigned position;
|
||||||
|
unsigned samples;
|
||||||
|
unsigned buf_samples;
|
||||||
|
float ratio;
|
||||||
} flac;
|
} flac;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_DR_MP3
|
#ifdef HAVE_DR_MP3
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
unsigned position;
|
|
||||||
unsigned samples;
|
|
||||||
unsigned buf_samples;
|
|
||||||
float* buffer;
|
|
||||||
float ratio;
|
|
||||||
drmp3 stream;
|
drmp3 stream;
|
||||||
void *resampler_data;
|
void *resampler_data;
|
||||||
const retro_resampler_t *resampler;
|
const retro_resampler_t *resampler;
|
||||||
|
float* buffer;
|
||||||
|
unsigned position;
|
||||||
|
unsigned samples;
|
||||||
|
unsigned buf_samples;
|
||||||
|
float ratio;
|
||||||
} mp3;
|
} mp3;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_IBXM
|
#ifdef HAVE_IBXM
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
unsigned position;
|
|
||||||
unsigned samples;
|
|
||||||
unsigned buf_samples;
|
|
||||||
int* buffer;
|
int* buffer;
|
||||||
struct replay* stream;
|
struct replay* stream;
|
||||||
struct module* module;
|
struct module* module;
|
||||||
|
unsigned position;
|
||||||
|
unsigned samples;
|
||||||
|
unsigned buf_samples;
|
||||||
} mod;
|
} mod;
|
||||||
#endif
|
#endif
|
||||||
} types;
|
} types;
|
||||||
|
audio_mixer_sound_t *sound;
|
||||||
|
audio_mixer_stop_cb_t stop_cb;
|
||||||
|
unsigned type;
|
||||||
|
float volume;
|
||||||
|
bool repeat;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* TODO/FIXME - static globals */
|
/* TODO/FIXME - static globals */
|
||||||
static struct audio_mixer_voice s_voices[AUDIO_MIXER_MAX_VOICES] = {{0}};
|
static struct audio_mixer_voice s_voices[AUDIO_MIXER_MAX_VOICES] = {0};
|
||||||
static unsigned s_rate = 0;
|
static unsigned s_rate = 0;
|
||||||
|
|
||||||
#ifdef HAVE_RWAV
|
#ifdef HAVE_RWAV
|
||||||
|
@ -68,15 +68,9 @@ static void *resampler_nearest_init(const struct resampler_config *config,
|
|||||||
{
|
{
|
||||||
rarch_nearest_resampler_t *re = (rarch_nearest_resampler_t*)
|
rarch_nearest_resampler_t *re = (rarch_nearest_resampler_t*)
|
||||||
calloc(1, sizeof(rarch_nearest_resampler_t));
|
calloc(1, sizeof(rarch_nearest_resampler_t));
|
||||||
|
|
||||||
(void)config;
|
|
||||||
(void)mask;
|
|
||||||
|
|
||||||
if (!re)
|
if (!re)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
re->fraction = 0;
|
re->fraction = 0;
|
||||||
|
|
||||||
return re;
|
return re;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -667,7 +667,7 @@ const struct file_archive_file_backend* file_archive_get_file_backend(const char
|
|||||||
uint32_t file_archive_get_file_crc32(const char *path)
|
uint32_t file_archive_get_file_crc32(const char *path)
|
||||||
{
|
{
|
||||||
file_archive_transfer_t state;
|
file_archive_transfer_t state;
|
||||||
struct archive_extract_userdata userdata = {{0}};
|
struct archive_extract_userdata userdata = {0};
|
||||||
bool returnerr = false;
|
bool returnerr = false;
|
||||||
const char *archive_path = NULL;
|
const char *archive_path = NULL;
|
||||||
bool contains_compressed = path_contains_compressed_file(path);
|
bool contains_compressed = path_contains_compressed_file(path);
|
||||||
|
@ -330,7 +330,7 @@ static int64_t zip_file_read(
|
|||||||
{
|
{
|
||||||
file_archive_transfer_t state = {ARCHIVE_TRANSFER_INIT};
|
file_archive_transfer_t state = {ARCHIVE_TRANSFER_INIT};
|
||||||
decomp_state_t decomp = {0};
|
decomp_state_t decomp = {0};
|
||||||
struct archive_extract_userdata userdata = {{0}};
|
struct archive_extract_userdata userdata = {0};
|
||||||
bool returnerr = true;
|
bool returnerr = true;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
@ -62,10 +62,10 @@ typedef struct
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
char drive;
|
cdrom_track_t track[99]; /* unsigned alignment */
|
||||||
|
cdrom_group_timeouts_t timeouts; /* unsigned short alignment */
|
||||||
unsigned char num_tracks;
|
unsigned char num_tracks;
|
||||||
cdrom_group_timeouts_t timeouts;
|
char drive;
|
||||||
cdrom_track_t track[99];
|
|
||||||
} cdrom_toc_t;
|
} cdrom_toc_t;
|
||||||
|
|
||||||
void cdrom_lba_to_msf(unsigned lba, unsigned char *min, unsigned char *sec, unsigned char *frame);
|
void cdrom_lba_to_msf(unsigned lba, unsigned char *min, unsigned char *sec, unsigned char *frame);
|
||||||
|
@ -60,49 +60,48 @@ typedef struct file_archive_handle
|
|||||||
|
|
||||||
typedef struct file_archive_transfer
|
typedef struct file_archive_transfer
|
||||||
{
|
{
|
||||||
enum file_archive_transfer_type type;
|
|
||||||
struct RFILE *archive_file;
|
|
||||||
int64_t archive_size;
|
int64_t archive_size;
|
||||||
void *context;
|
void *context;
|
||||||
unsigned step_total, step_current;
|
struct RFILE *archive_file;
|
||||||
const struct file_archive_file_backend *backend;
|
const struct file_archive_file_backend *backend;
|
||||||
#ifdef HAVE_MMAP
|
#ifdef HAVE_MMAP
|
||||||
int archive_mmap_fd;
|
|
||||||
uint8_t *archive_mmap_data;
|
uint8_t *archive_mmap_data;
|
||||||
|
int archive_mmap_fd;
|
||||||
#endif
|
#endif
|
||||||
|
unsigned step_total;
|
||||||
|
unsigned step_current;
|
||||||
|
enum file_archive_transfer_type type;
|
||||||
} file_archive_transfer_t;
|
} file_archive_transfer_t;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
file_archive_transfer_t archive; /* int64_t alignment */
|
||||||
char *source_file;
|
char *source_file;
|
||||||
char *subdir;
|
char *subdir;
|
||||||
char *target_dir;
|
char *target_dir;
|
||||||
char *target_file;
|
char *target_file;
|
||||||
char *valid_ext;
|
char *valid_ext;
|
||||||
|
|
||||||
char *callback_error;
|
char *callback_error;
|
||||||
|
|
||||||
file_archive_transfer_t archive;
|
|
||||||
struct archive_extract_userdata *userdata;
|
struct archive_extract_userdata *userdata;
|
||||||
} decompress_state_t;
|
} decompress_state_t;
|
||||||
|
|
||||||
struct archive_extract_userdata
|
struct archive_extract_userdata
|
||||||
{
|
{
|
||||||
/* These are set or read by the archive processing */
|
/* These are set or read by the archive processing */
|
||||||
char archive_path[PATH_MAX_LENGTH];
|
|
||||||
char current_file_path[PATH_MAX_LENGTH];
|
|
||||||
char *first_extracted_file_path;
|
char *first_extracted_file_path;
|
||||||
const char *extraction_directory;
|
const char *extraction_directory;
|
||||||
size_t archive_path_size;
|
|
||||||
struct string_list *ext;
|
struct string_list *ext;
|
||||||
struct string_list *list;
|
struct string_list *list;
|
||||||
bool found_file;
|
|
||||||
bool list_only;
|
|
||||||
uint32_t crc;
|
|
||||||
file_archive_transfer_t *transfer;
|
file_archive_transfer_t *transfer;
|
||||||
/* Not used by the processing, free to use outside or in iterate callback */
|
/* Not used by the processing, free to use outside or in iterate callback */
|
||||||
decompress_state_t *dec;
|
decompress_state_t *dec;
|
||||||
void* cb_data;
|
void* cb_data;
|
||||||
|
size_t archive_path_size;
|
||||||
|
uint32_t crc;
|
||||||
|
char archive_path[PATH_MAX_LENGTH];
|
||||||
|
char current_file_path[PATH_MAX_LENGTH];
|
||||||
|
bool found_file;
|
||||||
|
bool list_only;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Returns true when parsing should continue. False to stop. */
|
/* Returns true when parsing should continue. False to stop. */
|
||||||
|
@ -38,16 +38,8 @@
|
|||||||
struct chdstream
|
struct chdstream
|
||||||
{
|
{
|
||||||
chd_file *chd;
|
chd_file *chd;
|
||||||
/* Should we swap bytes? */
|
/* Loaded hunk */
|
||||||
bool swab;
|
uint8_t *hunkmem;
|
||||||
/* Size of frame taken from each hunk */
|
|
||||||
uint32_t frame_size;
|
|
||||||
/* Offset of data within frame */
|
|
||||||
uint32_t frame_offset;
|
|
||||||
/* Number of frames per hunk */
|
|
||||||
uint32_t frames_per_hunk;
|
|
||||||
/* First frame of track in chd */
|
|
||||||
uint32_t track_frame;
|
|
||||||
/* Byte offset where track data starts (after pregap) */
|
/* Byte offset where track data starts (after pregap) */
|
||||||
size_t track_start;
|
size_t track_start;
|
||||||
/* Byte offset where track data ends */
|
/* Byte offset where track data ends */
|
||||||
@ -56,16 +48,20 @@ struct chdstream
|
|||||||
size_t offset;
|
size_t offset;
|
||||||
/* Loaded hunk number */
|
/* Loaded hunk number */
|
||||||
int32_t hunknum;
|
int32_t hunknum;
|
||||||
/* Loaded hunk */
|
/* Size of frame taken from each hunk */
|
||||||
uint8_t *hunkmem;
|
uint32_t frame_size;
|
||||||
|
/* Offset of data within frame */
|
||||||
|
uint32_t frame_offset;
|
||||||
|
/* Number of frames per hunk */
|
||||||
|
uint32_t frames_per_hunk;
|
||||||
|
/* First frame of track in chd */
|
||||||
|
uint32_t track_frame;
|
||||||
|
/* Should we swap bytes? */
|
||||||
|
bool swab;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct metadata
|
typedef struct metadata
|
||||||
{
|
{
|
||||||
char type[64];
|
|
||||||
char subtype[32];
|
|
||||||
char pgtype[32];
|
|
||||||
char pgsub[32];
|
|
||||||
uint32_t frame_offset;
|
uint32_t frame_offset;
|
||||||
uint32_t frames;
|
uint32_t frames;
|
||||||
uint32_t pad;
|
uint32_t pad;
|
||||||
@ -73,6 +69,10 @@ typedef struct metadata
|
|||||||
uint32_t pregap;
|
uint32_t pregap;
|
||||||
uint32_t postgap;
|
uint32_t postgap;
|
||||||
uint32_t track;
|
uint32_t track;
|
||||||
|
char type[64];
|
||||||
|
char subtype[32];
|
||||||
|
char pgtype[32];
|
||||||
|
char pgsub[32];
|
||||||
} metadata_t;
|
} metadata_t;
|
||||||
|
|
||||||
static uint32_t padding_frames(uint32_t frames)
|
static uint32_t padding_frames(uint32_t frames)
|
||||||
|
@ -35,8 +35,6 @@
|
|||||||
|
|
||||||
struct intfstream_internal
|
struct intfstream_internal
|
||||||
{
|
{
|
||||||
enum intfstream_type type;
|
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
RFILE *fp;
|
RFILE *fp;
|
||||||
@ -44,19 +42,19 @@ struct intfstream_internal
|
|||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
memstream_t *fp;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
uint8_t *data;
|
uint8_t *data;
|
||||||
uint64_t size;
|
uint64_t size;
|
||||||
} buf;
|
} buf;
|
||||||
memstream_t *fp;
|
|
||||||
bool writable;
|
bool writable;
|
||||||
} memory;
|
} memory;
|
||||||
#ifdef HAVE_CHD
|
#ifdef HAVE_CHD
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
int32_t track;
|
|
||||||
chdstream_t *fp;
|
chdstream_t *fp;
|
||||||
|
int32_t track;
|
||||||
} chd;
|
} chd;
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_ZLIB)
|
#if defined(HAVE_ZLIB)
|
||||||
@ -65,6 +63,7 @@ struct intfstream_internal
|
|||||||
rzipstream_t *fp;
|
rzipstream_t *fp;
|
||||||
} rzip;
|
} rzip;
|
||||||
#endif
|
#endif
|
||||||
|
enum intfstream_type type;
|
||||||
};
|
};
|
||||||
|
|
||||||
int64_t intfstream_get_size(intfstream_internal_t *intf)
|
int64_t intfstream_get_size(intfstream_internal_t *intf)
|
||||||
|
@ -33,10 +33,10 @@ static uint64_t last_file_size = 0;
|
|||||||
|
|
||||||
struct memstream
|
struct memstream
|
||||||
{
|
{
|
||||||
uint8_t *buf;
|
|
||||||
uint64_t size;
|
uint64_t size;
|
||||||
uint64_t ptr;
|
uint64_t ptr;
|
||||||
uint64_t max_ptr;
|
uint64_t max_ptr;
|
||||||
|
uint8_t *buf;
|
||||||
unsigned writing;
|
unsigned writing;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -47,10 +47,7 @@
|
|||||||
/* Holds all metadata for an RZIP file stream */
|
/* Holds all metadata for an RZIP file stream */
|
||||||
struct rzipstream
|
struct rzipstream
|
||||||
{
|
{
|
||||||
bool is_compressed;
|
|
||||||
bool is_writing;
|
|
||||||
uint64_t size;
|
uint64_t size;
|
||||||
uint32_t chunk_size;
|
|
||||||
/* virtual_ptr: Used to track how much
|
/* virtual_ptr: Used to track how much
|
||||||
* uncompressed data has been read */
|
* uncompressed data has been read */
|
||||||
uint64_t virtual_ptr;
|
uint64_t virtual_ptr;
|
||||||
@ -60,12 +57,15 @@ struct rzipstream
|
|||||||
const struct trans_stream_backend *inflate_backend;
|
const struct trans_stream_backend *inflate_backend;
|
||||||
void *inflate_stream;
|
void *inflate_stream;
|
||||||
uint8_t *in_buf;
|
uint8_t *in_buf;
|
||||||
|
uint8_t *out_buf;
|
||||||
uint32_t in_buf_size;
|
uint32_t in_buf_size;
|
||||||
uint32_t in_buf_ptr;
|
uint32_t in_buf_ptr;
|
||||||
uint8_t *out_buf;
|
|
||||||
uint32_t out_buf_size;
|
uint32_t out_buf_size;
|
||||||
uint32_t out_buf_ptr;
|
uint32_t out_buf_ptr;
|
||||||
uint32_t out_buf_occupancy;
|
uint32_t out_buf_occupancy;
|
||||||
|
uint32_t chunk_size;
|
||||||
|
bool is_compressed;
|
||||||
|
bool is_writing;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Header Functions */
|
/* Header Functions */
|
||||||
|
@ -29,9 +29,9 @@
|
|||||||
|
|
||||||
struct zlib_trans_stream
|
struct zlib_trans_stream
|
||||||
{
|
{
|
||||||
bool inited;
|
|
||||||
int ex; /* window_bits or level */
|
|
||||||
z_stream z;
|
z_stream z;
|
||||||
|
int ex; /* window_bits or level */
|
||||||
|
bool inited;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void *zlib_deflate_stream_new(void)
|
static void *zlib_deflate_stream_new(void)
|
||||||
|
26
retroarch.c
26
retroarch.c
@ -1939,7 +1939,7 @@ struct rarch_state
|
|||||||
menu_input_t menu_input_state; /* retro_time_t alignment */
|
menu_input_t menu_input_state; /* retro_time_t alignment */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
retro_usec_t runloop_frame_time_last;
|
retro_usec_t runloop_frame_time_last; /* int64_t alignment */
|
||||||
|
|
||||||
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL)
|
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL)
|
||||||
rarch_timer_t shader_delay_timer; /* int64_t alignment */
|
rarch_timer_t shader_delay_timer; /* int64_t alignment */
|
||||||
@ -28996,7 +28996,7 @@ static bool audio_compute_buffer_statistics(
|
|||||||
(unsigned)p_rarch->audio_driver_free_samples_count,
|
(unsigned)p_rarch->audio_driver_free_samples_count,
|
||||||
AUDIO_BUFFER_FREE_SAMPLES_COUNT);
|
AUDIO_BUFFER_FREE_SAMPLES_COUNT);
|
||||||
|
|
||||||
if (!stats || samples < 3)
|
if (samples < 3)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
stats->samples = (unsigned)
|
stats->samples = (unsigned)
|
||||||
@ -29049,13 +29049,19 @@ static bool audio_compute_buffer_statistics(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
static void report_audio_buffer_statistics(struct rarch_state *p_rarch)
|
static void report_audio_buffer_statistics(struct rarch_state *p_rarch)
|
||||||
{
|
{
|
||||||
audio_statistics_t audio_stats = {0.0f};
|
audio_statistics_t audio_stats;
|
||||||
|
audio_stats.samples = 0;
|
||||||
|
audio_stats.average_buffer_saturation = 0.0f;
|
||||||
|
audio_stats.std_deviation_percentage = 0.0f;
|
||||||
|
audio_stats.close_to_underrun = 0.0f;
|
||||||
|
audio_stats.close_to_blocking = 0.0f;
|
||||||
|
|
||||||
if (!audio_compute_buffer_statistics(p_rarch, &audio_stats))
|
if (!audio_compute_buffer_statistics(p_rarch, &audio_stats))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
RARCH_LOG("[Audio]: Average audio buffer saturation: %.2f %%,"
|
RARCH_LOG("[Audio]: Average audio buffer saturation: %.2f %%,"
|
||||||
" standard deviation (percentage points): %.2f %%.\n"
|
" standard deviation (percentage points): %.2f %%.\n"
|
||||||
"[Audio]: Amount of time spent close to underrun: %.2f %%."
|
"[Audio]: Amount of time spent close to underrun: %.2f %%."
|
||||||
@ -29064,8 +29070,8 @@ static void report_audio_buffer_statistics(struct rarch_state *p_rarch)
|
|||||||
audio_stats.std_deviation_percentage,
|
audio_stats.std_deviation_percentage,
|
||||||
audio_stats.close_to_underrun,
|
audio_stats.close_to_underrun,
|
||||||
audio_stats.close_to_blocking);
|
audio_stats.close_to_blocking);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* config_get_audio_driver_options:
|
* config_get_audio_driver_options:
|
||||||
@ -29134,7 +29140,9 @@ static bool audio_driver_deinit_internal(struct rarch_state *p_rarch)
|
|||||||
#ifdef HAVE_DSP_FILTER
|
#ifdef HAVE_DSP_FILTER
|
||||||
audio_driver_dsp_filter_free();
|
audio_driver_dsp_filter_free();
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef DEBUG
|
||||||
report_audio_buffer_statistics(p_rarch);
|
report_audio_buffer_statistics(p_rarch);
|
||||||
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -32980,7 +32988,7 @@ static void video_driver_frame(const void *data, unsigned width,
|
|||||||
|
|
||||||
if (video_info.statistics_show)
|
if (video_info.statistics_show)
|
||||||
{
|
{
|
||||||
audio_statistics_t audio_stats = {0.0f};
|
audio_statistics_t audio_stats;
|
||||||
double stddev = 0.0;
|
double stddev = 0.0;
|
||||||
struct retro_system_av_info *av_info = &p_rarch->video_driver_av_info;
|
struct retro_system_av_info *av_info = &p_rarch->video_driver_av_info;
|
||||||
unsigned red = 255;
|
unsigned red = 255;
|
||||||
@ -32988,6 +32996,12 @@ static void video_driver_frame(const void *data, unsigned width,
|
|||||||
unsigned blue = 255;
|
unsigned blue = 255;
|
||||||
unsigned alpha = 255;
|
unsigned alpha = 255;
|
||||||
|
|
||||||
|
audio_stats.samples = 0;
|
||||||
|
audio_stats.average_buffer_saturation = 0.0f;
|
||||||
|
audio_stats.std_deviation_percentage = 0.0f;
|
||||||
|
audio_stats.close_to_underrun = 0.0f;
|
||||||
|
audio_stats.close_to_blocking = 0.0f;
|
||||||
|
|
||||||
video_monitor_fps_statistics(NULL, &stddev, NULL);
|
video_monitor_fps_statistics(NULL, &stddev, NULL);
|
||||||
|
|
||||||
video_info.osd_stat_params.x = 0.010f;
|
video_info.osd_stat_params.x = 0.010f;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user