ALSA Backend: align midi output buffer with n_periods (currently 2)

This commit is contained in:
Robin Gareus 2014-06-08 15:53:15 +02:00
parent eb289a76af
commit b3a44ea32b
2 changed files with 23 additions and 11 deletions

View file

@ -141,10 +141,13 @@ class AlsaMidiPort : public AlsaPort {
DataType type () const { return DataType::MIDI; };
void* get_buffer (pframes_t nframes);
const AlsaMidiBuffer const_buffer () const { return _buffer; }
const AlsaMidiBuffer const_buffer () const { return _buffer[_bufperiod]; }
void next_period() { get_buffer(0); _bufperiod = (_bufperiod + 1) % 2; }
private:
AlsaMidiBuffer _buffer;
AlsaMidiBuffer _buffer[2];
int _bufperiod;
}; // class AlsaMidiPort
class AlsaAudioBackend : public AudioBackend {