Maybe fixed the glitchiness at startup even more?

This commit is contained in:
rexy712
2020-08-22 15:50:52 -07:00
parent dd7ccc85b9
commit fa5c203cf8
5 changed files with 13 additions and 10 deletions

View File

@@ -29,8 +29,10 @@ namespace audio::detail{
std::tuple<Args...> m_args;
template<int... Indices>
int operator()(const void* input, void* output, unsigned long frame_count, std::integer_sequence<int,Indices...>){
return std::forward<Func>(m_f)(input, output, frame_count, std::get<Indices>(m_args)...);
int operator()(const void* input, void* output, unsigned long frame_count,
unsigned long flags, std::integer_sequence<int,Indices...>)
{
return std::forward<Func>(m_f)(input, output, frame_count, flags, std::get<Indices>(m_args)...);
}
};
@@ -40,7 +42,7 @@ namespace audio::detail{
callback_iface() = default;
virtual ~callback_iface() = default;
virtual int operator()(const void* input, void* output, unsigned long frame_count) = 0;
virtual int operator()(const void* input, void* output, unsigned long frame_count, unsigned long flags) = 0;
};
template<typename Func, typename... Args>
@@ -52,8 +54,8 @@ namespace audio::detail{
template<class Fn, class... Ts>
callback_impl(Fn&& f, Ts&&... ts):
m_ch{std::forward<Fn>(f), {std::forward<Ts>(ts)...}}{}
int operator()(const void* input, void* output, unsigned long frame_count)override{
return m_ch(input, output, frame_count, typename ::util::sequence_gen<sizeof...(Args)>::type{});
int operator()(const void* input, void* output, unsigned long frame_count, unsigned long flags)override{
return m_ch(input, output, frame_count, flags, typename ::util::sequence_gen<sizeof...(Args)>::type{});
}
};
}

View File

@@ -68,7 +68,7 @@ namespace audio::impl{
void exit();
size_t output_channels()const;
private:
static int callback(const void* /*input*/, void* output, unsigned long frame_count, mixer& mix);
static int callback(const void* /*input*/, void* output, unsigned long frame_count, unsigned long flags, mixer& mix);
};
}