Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme addition 1st draft & conditional guard cleaning #97

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions Classes/AudioStreamer.m
Original file line number Diff line number Diff line change
Expand Up @@ -1356,24 +1356,20 @@ - (void)handleReadFromStream:(CFReadStreamRef)aStream
}
}

// make this conditional into a guard that just changes the inFlags, no need for repetitive stuff.
UInt32 inFlags = 0;
if (discontinuous)
{
err = AudioFileStreamParseBytes(audioFileStream, length, bytes, kAudioFileStreamParseFlag_Discontinuity);
if (err)
{
[self failWithErrorCode:AS_FILE_STREAM_PARSE_BYTES_FAILED];
return;
}
inFlags = kAudioFileStreamParseFlag_Discontinuity;
}
else

err = AudioFileStreamParseBytes(audioFileStream, length, bytes, inFlags);
if (err)
{
err = AudioFileStreamParseBytes(audioFileStream, length, bytes, 0);
if (err)
{
[self failWithErrorCode:AS_FILE_STREAM_PARSE_BYTES_FAILED];
return;
}
[self failWithErrorCode:AS_FILE_STREAM_PARSE_BYTES_FAILED];
return;
}

}
}

Expand Down
Loading