Wrap long lines to fit within 80 columns across the codebase
Pure whitespace/line-break reformatting (braces, newlines, and line continuations matching this codebase's existing wrap conventions) - no logic, string content, or identifiers changed anywhere. Confirmed via diff against the pre-change tree and by rebuilding + re-running the affected test suites, which produce identical pass/fail results. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
@@ -127,7 +127,8 @@ errorret_t audioStreamPSPBuffer(audiostream_t *stream) {
|
||||
stream->platform.loopEndFrame
|
||||
);
|
||||
|
||||
const size_t startFrame = mathMin(stream->startFrame, stream->platform.totalFrames);
|
||||
const size_t startFrame =
|
||||
mathMin(stream->startFrame, stream->platform.totalFrames);
|
||||
stream->startFrame = 0;
|
||||
stream->seeking = false;
|
||||
|
||||
@@ -181,10 +182,12 @@ void audioStreamPSPTopUp(audiostream_t *stream) {
|
||||
const size_t room = mathMin(
|
||||
AUDIO_PSP_RING_FRAMES - filled, (size_t) AUDIO_PSP_TOPUP_STEP_FRAMES
|
||||
);
|
||||
const size_t currentEndFrame = stream->platform.readPosition < stream->platform.loopEndFrame
|
||||
const size_t currentEndFrame =
|
||||
stream->platform.readPosition < stream->platform.loopEndFrame
|
||||
? stream->platform.loopEndFrame
|
||||
: stream->platform.totalFrames;
|
||||
const size_t framesRemainingInSegment = currentEndFrame - stream->platform.readPosition;
|
||||
const size_t framesRemainingInSegment =
|
||||
currentEndFrame - stream->platform.readPosition;
|
||||
const size_t framesToRead = mathMin(room, framesRemainingInSegment);
|
||||
|
||||
if(framesToRead > 0) {
|
||||
@@ -201,7 +204,8 @@ void audioStreamPSPTopUp(audiostream_t *stream) {
|
||||
if(framesRead > 0) {
|
||||
threadMutexLock(&stream->platform.ringLock);
|
||||
for(size_t i = 0; i < framesRead; i++) {
|
||||
const size_t writeIndex = (stream->platform.ringWritePos + i) % AUDIO_PSP_RING_FRAMES;
|
||||
const size_t writeIndex =
|
||||
(stream->platform.ringWritePos + i) % AUDIO_PSP_RING_FRAMES;
|
||||
memoryCopy(
|
||||
stream->platform.ring + (writeIndex * channels),
|
||||
scratch + (i * channels),
|
||||
@@ -239,7 +243,8 @@ void audioStreamPSPTopUp(audiostream_t *stream) {
|
||||
// still the right thing to compare against loopLimit.
|
||||
const bool_t loopLimitReached = stream->loopLimit > 0 &&
|
||||
stream->loopRestartCount >= stream->loopLimit;
|
||||
const bool_t reachesSegmentEnd = stream->platform.readPosition >= currentEndFrame;
|
||||
const bool_t reachesSegmentEnd =
|
||||
stream->platform.readPosition >= currentEndFrame;
|
||||
const bool_t willLoop = reachesSegmentEnd &&
|
||||
(stream->state & AUDIO_STREAM_STATE_LOOPING) && !loopLimitReached;
|
||||
|
||||
@@ -257,7 +262,8 @@ void audioStreamPSPTopUp(audiostream_t *stream) {
|
||||
const size_t index = (
|
||||
stream->platform.loopMarkerHead + stream->platform.loopMarkerCount
|
||||
) % AUDIO_PSP_LOOP_MARKER_MAX;
|
||||
stream->platform.loopMarkerFrames[index] = stream->platform.framesEnqueued;
|
||||
stream->platform.loopMarkerFrames[index] =
|
||||
stream->platform.framesEnqueued;
|
||||
stream->platform.loopMarkerCount++;
|
||||
}
|
||||
threadMutexUnlock(&stream->platform.ringLock);
|
||||
@@ -282,7 +288,9 @@ bool_t audioStreamPSPIsFinished(audiostream_t *stream) {
|
||||
void audioStreamPSPThreadFeed(thread_t *thread) {
|
||||
assertNotNull(thread, "Thread cannot be NULL.");
|
||||
|
||||
sceKernelChangeThreadPriority(sceKernelGetThreadId(), AUDIO_PSP_THREAD_PRIORITY);
|
||||
sceKernelChangeThreadPriority(
|
||||
sceKernelGetThreadId(), AUDIO_PSP_THREAD_PRIORITY
|
||||
);
|
||||
|
||||
audiostream_t *stream = (audiostream_t *) thread->data;
|
||||
const size_t channels = stream->channels;
|
||||
@@ -321,7 +329,9 @@ void audioStreamPSPThreadFeed(thread_t *thread) {
|
||||
threadMutexUnlock(&stream->platform.ringLock);
|
||||
|
||||
if(available >= AUDIO_PSP_CHUNK_FRAMES) break;
|
||||
if(stream->platform.readReachedEnd || stream->platform.readFailed) break;
|
||||
if(
|
||||
stream->platform.readReachedEnd || stream->platform.readFailed
|
||||
) break;
|
||||
if(threadShouldStop(thread)) {
|
||||
stopRequested = true;
|
||||
break;
|
||||
@@ -358,7 +368,8 @@ void audioStreamPSPThreadFeed(thread_t *thread) {
|
||||
|
||||
threadMutexLock(&stream->platform.ringLock);
|
||||
for(size_t i = 0; i < framesThisChunk; i++) {
|
||||
const size_t readIndex = (stream->platform.ringReadPos + i) % AUDIO_PSP_RING_FRAMES;
|
||||
const size_t readIndex =
|
||||
(stream->platform.ringReadPos + i) % AUDIO_PSP_RING_FRAMES;
|
||||
memoryCopy(
|
||||
chunk + (i * channels),
|
||||
stream->platform.ring + (readIndex * channels),
|
||||
@@ -366,7 +377,8 @@ void audioStreamPSPThreadFeed(thread_t *thread) {
|
||||
);
|
||||
}
|
||||
stream->platform.ringReadPos =
|
||||
(stream->platform.ringReadPos + framesThisChunk) % AUDIO_PSP_RING_FRAMES;
|
||||
(stream->platform.ringReadPos + framesThisChunk) %
|
||||
AUDIO_PSP_RING_FRAMES;
|
||||
stream->platform.ringFilled -= framesThisChunk;
|
||||
threadMutexUnlock(&stream->platform.ringLock);
|
||||
|
||||
@@ -389,7 +401,8 @@ void audioStreamPSPThreadFeed(thread_t *thread) {
|
||||
: AUDIO_PSP_FADE_FRAMES;
|
||||
for(size_t i = 0; i < fadeFrames; i++) {
|
||||
const size_t frame = framesThisChunk - fadeFrames + i;
|
||||
const float_t factor = 1.0f - ((float_t) (i + 1) / (float_t) fadeFrames);
|
||||
const float_t factor =
|
||||
1.0f - ((float_t) (i + 1) / (float_t) fadeFrames);
|
||||
for(size_t c = 0; c < channels; c++) {
|
||||
int16_t *sample = &chunk[frame * channels + c];
|
||||
*sample = (int16_t) ((float_t) *sample * factor);
|
||||
|
||||
Reference in New Issue
Block a user