diff options
author | Max Horn | 2003-07-29 01:36:10 +0000 |
---|---|---|
committer | Max Horn | 2003-07-29 01:36:10 +0000 |
commit | 1be944755f1f089b5b000852a9fc34c8b5eea017 (patch) | |
tree | fd513fec8190330ffc4b86e0c97121f4e19c4afc | |
parent | 3f99e8d1d4e757dcbc54dba7872a4ffddeab1076 (diff) | |
download | scummvm-rg350-1be944755f1f089b5b000852a9fc34c8b5eea017.tar.gz scummvm-rg350-1be944755f1f089b5b000852a9fc34c8b5eea017.tar.bz2 scummvm-rg350-1be944755f1f089b5b000852a9fc34c8b5eea017.zip |
added makeRateConverter factory function
svn-id: r9270
-rw-r--r-- | sound/rate.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sound/rate.h b/sound/rate.h index de1180b1f7..2ac69cc411 100644 --- a/sound/rate.h +++ b/sound/rate.h @@ -93,5 +93,17 @@ public: } }; +static inline RateConverter *makeRateConverter(st_rate_t inrate, st_rate_t outrate, bool stereo) { + printf("makeRateConverter: inrate %d, outrate %d\n", inrate, outrate); + if (inrate != outrate) { + return new LinearRateConverter(inrate, outrate); + //return new ResampleRateConverter(inrate, outrate, 1); + } else { + if (stereo) + return new CopyRateConverter<true>(); + else + return new CopyRateConverter<false>(); + } +} #endif |