The direction should not be reversed if the delta is too large. The new code is redundant, but the intent is more obvious.
The reported sample length in the aif header can differ from the actual length of the SSND chunk. The END marker was being misused to contain the reported length, but this still counts as a loop in aif2agb, even if the START marker is omitted (it defaults to the END value). Now the reported length is in the COMM chunk, which is more correct.