Remove unnecessary check_sample_rate

This commit is contained in:
bnnm 2017-11-23 23:11:11 +01:00
parent c2ef5f8694
commit e1bb468bd5
4 changed files with 3 additions and 10 deletions

View File

@ -61,7 +61,7 @@ VGMSTREAM * init_vgmstream_aix(STREAMFILE *streamFile) {
goto fail;
sample_rate = read_32bitBE(stream_list_offset+8,streamFile);
if (!check_sample_rate(sample_rate))
if (sample_rate < 300 || sample_rate > 96000)
goto fail;
samples_in_segment = calloc(segment_count,sizeof(int32_t));

View File

@ -2,10 +2,6 @@
#include "util.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 * ext;

View File

@ -61,9 +61,6 @@ static inline int get_low_nibble_signed(uint8_t n) {
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
* extension in the original filename or the ending null byte if no extension
*/

View File

@ -400,8 +400,8 @@ static VGMSTREAM * init_vgmstream_internal(STREAMFILE *streamFile, int do_dfs) {
continue;
}
/* everything should have a reasonable sample rate (a verification of the metadata) */
if (!check_sample_rate(vgmstream->sample_rate)) {
/* everything should have a reasonable sample rate (300 is Wwise min) */
if (vgmstream->sample_rate < 300 || vgmstream->sample_rate > 96000) {
VGM_LOG("VGMSTREAM: wrong sample rate (sr=%i)\n", vgmstream->sample_rate);
close_vgmstream(vgmstream);
continue;