src/audio/sdlgenaudiocvt.pl
changeset 4889 8c9cbb623d55
parent 3602 bfa8d34ce03a
child 5262 b530ef003506
     1.1 --- a/src/audio/sdlgenaudiocvt.pl	Sat Sep 18 17:12:19 2010 -0700
     1.2 +++ b/src/audio/sdlgenaudiocvt.pl	Sat Sep 18 18:15:08 2010 -0700
     1.3 @@ -38,7 +38,7 @@
     1.4  /* DO NOT EDIT!  This file is generated by sdlgenaudiocvt.pl */
     1.5  /*
     1.6      SDL - Simple DirectMedia Layer
     1.7 -    Copyright (C) 1997-2009 Sam Lantinga
     1.8 +    Copyright (C) 1997-2010 Sam Lantinga
     1.9  
    1.10      This library is free software; you can redistribute it and/or
    1.11      modify it under the terms of the GNU Lesser General Public
    1.12 @@ -400,15 +400,19 @@
    1.13      register int eps = 0;
    1.14  EOF
    1.15  
    1.16 +    my $endcomparison = '!=';
    1.17 +
    1.18      # Upsampling (growing the buffer) needs to work backwards, since we
    1.19      #  overwrite the buffer as we go.
    1.20      if ($upsample) {
    1.21 +        $endcomparison = '>';  # dst > target
    1.22          print <<EOF;
    1.23      $fctype *dst = (($fctype *) (cvt->buf + dstsize)) - $channels;
    1.24      const $fctype *src = (($fctype *) (cvt->buf + cvt->len_cvt)) - $channels;
    1.25      const $fctype *target = ((const $fctype *) cvt->buf) - $channels;
    1.26  EOF
    1.27      } else {
    1.28 +        $endcomparison = '<';  # dst < target
    1.29          print <<EOF;
    1.30      $fctype *dst = ($fctype *) cvt->buf;
    1.31      const $fctype *src = ($fctype *) cvt->buf;
    1.32 @@ -432,7 +436,7 @@
    1.33      }
    1.34  
    1.35      print <<EOF;
    1.36 -    while (dst != target) {
    1.37 +    while (dst $endcomparison target) {
    1.38  EOF
    1.39  
    1.40      if ($upsample) {