Re: [tim-janik/beast] BSE: driver-alsa.cc: fix crash in retrigger code (#127)



@tim-janik requested changes on this pull request.


In bse/driver-alsa.cc:

> @@ -427,7 +427,8 @@ class AlsaPcmDriver : public PcmDriver {
     if (write_handle_)
       {
         int n, buffer_length = n_periods_ * period_size_; // buffer size chosen by ALSA based on latency request
-        const float *zeros = bse_engine_const_zeros (buffer_length / 2); // sizeof (int16) / sizeof (float)
+        const size_t frame_size = n_channels_ * sizeof (period_buffer_[0]);
+        const uint8  zeros[buffer_length * frame_size] = { 0, };

Clang doesn't support intiializing variable length arrays from non-const.
Generally, period_size_ should never be bigger than the engineblock size, actually the two should be same. It's probably most simple to call snd_pcm_writei for n_periods_ times.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]