Check if there are samples to play so it won't generate empty files

This commit is contained in:
bnnm 2016-11-11 23:36:12 +01:00
parent 5cd11594e2
commit cc9b21bd48

View File

@ -360,6 +360,13 @@ VGMSTREAM * init_vgmstream_internal(STREAMFILE *streamFile, int do_dfs) {
if (vgmstream) {
/* these are little hacky checks */
/* fail if there is nothing to play
* (without this check vgmstream can generate empty files) */
if ( vgmstream->num_samples==0 ) {
close_vgmstream(vgmstream);
continue;
}
/* everything should have a reasonable sample rate
* (a verification of the metadata) */
if (!check_sample_rate(vgmstream->sample_rate)) {