mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-18 07:44:43 +01:00
Check if there are samples to play so it won't generate empty files
This commit is contained in:
parent
5cd11594e2
commit
cc9b21bd48
@ -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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user