Skip to content

Commit

Permalink
Print error messages when cannot read/parse an audio file
Browse files Browse the repository at this point in the history
  • Loading branch information
corporateshark committed Nov 1, 2021
1 parent 461d3c8 commit 19f816a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,18 @@ int main( int argc, char* argv[] )
{
auto FileName = g_Playlist.GetAndPopNextTrack( g_Config.m_Loop );
auto DataBlob = ReadFileAsBlob( FileName.c_str() );
if (!DataBlob || !DataBlob->GetDataSize()) continue;
if (!DataBlob || !DataBlob->GetDataSize())
{
printf("Cannot read file %s\n", FileName.c_str());
continue;
}

auto Provider = CreateWaveDataProvider( FileName.c_str(), DataBlob );
if (!Provider) continue;
if (!Provider)
{
printf("Cannot parse file %s\n", FileName.c_str());
continue;
}

if (Encoder)
{
Expand Down

0 comments on commit 19f816a

Please sign in to comment.