mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-30 20:03:44 +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) {
|
if (vgmstream) {
|
||||||
/* these are little hacky checks */
|
/* 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
|
/* everything should have a reasonable sample rate
|
||||||
* (a verification of the metadata) */
|
* (a verification of the metadata) */
|
||||||
if (!check_sample_rate(vgmstream->sample_rate)) {
|
if (!check_sample_rate(vgmstream->sample_rate)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user