Audaspace:
[blender.git] / intern / audaspace / intern / AUD_JOSResampleReader.cpp
index 2fb8b86ce49ed7a07b35c08a1385f1a7ac9febc5..62fab48272bf1fff4c0d5836b8cf402a5482870a 100644 (file)
@@ -68,7 +68,7 @@ static inline int lrint(double d)
 #define fp_rest(x) (x & ((1 << SHIFT_BITS) - 1))
 #define fp_rest_to_double(x) fp_to_double(fp_rest(x))
 
-AUD_JOSResampleReader::AUD_JOSResampleReader(AUD_Reference<AUD_IReader> reader, AUD_Specs specs) :
+AUD_JOSResampleReader::AUD_JOSResampleReader(boost::shared_ptr<AUD_IReader> reader, AUD_Specs specs) :
        AUD_ResampleReader(reader, specs.rate),
        m_channels(AUD_CHANNELS_INVALID),
        m_n(0),
@@ -200,7 +200,7 @@ void AUD_JOSResampleReader::updateBuffer(int size, double factor, int samplesize
                                left\
                        }\
 \
-                       P = -P;\
+                       P = 0 - P;\
 \
                        end = (int_to_fp(m_len) - P) / P_increment - 1;\
                        if(m_cache_valid - m_n - 2 < end)\