Timeline: Don't assert if peakfile contains no blocks---it's probably just because it was just opened and hasn't been written into yet.

This commit is contained in:
Jonathan Moore Liles 2020-12-12 22:04:40 -08:00
parent 793a9c1d4b
commit 20dce6c6e6
1 changed files with 16 additions and 3 deletions

View File

@ -188,7 +188,10 @@ public:
}
if ( ! blocks.size() )
FATAL( "Peak file contains no blocks!" );
{
DWARNING( "Peak file contains no blocks, maybe it's still being generated?");
return;
}
blocks.sort();
@ -258,10 +261,20 @@ public:
scan( chunksize );
assert( _chunksize );
/* assert( _chunksize ); */
if ( blocks.size() )
{
return true;
}
else
{
DWARNING( "Peak file could not be opened: no blocks" );
fclose(_fp);
_fp = NULL;
return false;
}
}
bool
open ( FILE *fp, int channels, nframes_t chunksize )