diff options
author | Max Horn | 2003-08-02 18:29:52 +0000 |
---|---|---|
committer | Max Horn | 2003-08-02 18:29:52 +0000 |
commit | 20ba0865117ed865bc92a0e1e633dfc10c431587 (patch) | |
tree | 94273daa9034f03ce3d55ad1e7e5f394d8512b01 /sound/rate.cpp | |
parent | c373ca107d1f1d809e3c655a7245c185eb2e08f3 (diff) | |
download | scummvm-rg350-20ba0865117ed865bc92a0e1e633dfc10c431587.tar.gz scummvm-rg350-20ba0865117ed865bc92a0e1e633dfc10c431587.tar.bz2 scummvm-rg350-20ba0865117ed865bc92a0e1e633dfc10c431587.zip |
slightly cut down on the number of times eof() is called
svn-id: r9423
Diffstat (limited to 'sound/rate.cpp')
-rw-r--r-- | sound/rate.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sound/rate.cpp b/sound/rate.cpp index 2ae24595c9..4f05dd326e 100644 --- a/sound/rate.cpp +++ b/sound/rate.cpp @@ -117,10 +117,15 @@ int LinearRateConverter<stereo, reverseStereo>::flow(AudioInputStream &input, st ostart = obuf; oend = obuf + *osamp * 2; - while (obuf < oend && !input.eof()) { + while (obuf < oend) { // read enough input samples so that ipos > opos while (ipos <= opos + 1) { + + // Abort if we reached the end of the input buffer + if (input.eof()) + goto the_end; + ilast[0] = icur[0]; icur[0] = input.read(); if (stereo) { @@ -128,10 +133,6 @@ int LinearRateConverter<stereo, reverseStereo>::flow(AudioInputStream &input, st icur[1] = input.read(); } ipos++; - - // Abort if we reached the end of the input buffer - if (input.eof()) - goto the_end; } // Loop as long as the outpos trails behind, and as long as there is |