mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-18 07:44:43 +01:00
Remove unnecessary check_sample_rate
This commit is contained in:
parent
c2ef5f8694
commit
e1bb468bd5
@ -61,7 +61,7 @@ VGMSTREAM * init_vgmstream_aix(STREAMFILE *streamFile) {
|
|||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
sample_rate = read_32bitBE(stream_list_offset+8,streamFile);
|
sample_rate = read_32bitBE(stream_list_offset+8,streamFile);
|
||||||
if (!check_sample_rate(sample_rate))
|
if (sample_rate < 300 || sample_rate > 96000)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
samples_in_segment = calloc(segment_count,sizeof(int32_t));
|
samples_in_segment = calloc(segment_count,sizeof(int32_t));
|
||||||
|
@ -2,10 +2,6 @@
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "streamtypes.h"
|
#include "streamtypes.h"
|
||||||
|
|
||||||
int check_sample_rate(int32_t sr) {
|
|
||||||
return !(sr<300 || sr>96000);
|
|
||||||
}
|
|
||||||
|
|
||||||
const char * filename_extension(const char * filename) {
|
const char * filename_extension(const char * filename) {
|
||||||
const char * ext;
|
const char * ext;
|
||||||
|
|
||||||
|
@ -61,9 +61,6 @@ static inline int get_low_nibble_signed(uint8_t n) {
|
|||||||
return nibble_to_int[n&0xf];
|
return nibble_to_int[n&0xf];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* return true for a good sample rate */
|
|
||||||
int check_sample_rate(int32_t sr);
|
|
||||||
|
|
||||||
/* return a file's extension (a pointer to the first character of the
|
/* return a file's extension (a pointer to the first character of the
|
||||||
* extension in the original filename or the ending null byte if no extension
|
* extension in the original filename or the ending null byte if no extension
|
||||||
*/
|
*/
|
||||||
|
@ -400,8 +400,8 @@ static VGMSTREAM * init_vgmstream_internal(STREAMFILE *streamFile, int do_dfs) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* everything should have a reasonable sample rate (a verification of the metadata) */
|
/* everything should have a reasonable sample rate (300 is Wwise min) */
|
||||||
if (!check_sample_rate(vgmstream->sample_rate)) {
|
if (vgmstream->sample_rate < 300 || vgmstream->sample_rate > 96000) {
|
||||||
VGM_LOG("VGMSTREAM: wrong sample rate (sr=%i)\n", vgmstream->sample_rate);
|
VGM_LOG("VGMSTREAM: wrong sample rate (sr=%i)\n", vgmstream->sample_rate);
|
||||||
close_vgmstream(vgmstream);
|
close_vgmstream(vgmstream);
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user