fix: stream stops and dies on underflow
This commit is contained in:
@@ -58,6 +58,7 @@ namespace audio {
|
||||
bool keepSource;
|
||||
char buffer[BUFFER_SIZE];
|
||||
bool loop = false;
|
||||
bool stopOnEnd = false;
|
||||
|
||||
bool preloadBuffer(uint buffer, bool loop);
|
||||
void unqueueBuffers(uint alsource);
|
||||
@@ -80,6 +81,10 @@ namespace audio {
|
||||
void setTime(duration_t time) override;
|
||||
|
||||
static inline constexpr uint STREAM_BUFFERS = 3;
|
||||
|
||||
bool isStopOnEnd() const override;
|
||||
|
||||
void setStopOnEnd(bool stopOnEnd) override;
|
||||
};
|
||||
|
||||
class ALInputDevice : public InputDevice {
|
||||
@@ -117,7 +122,7 @@ namespace audio {
|
||||
float volume = 0.0f;
|
||||
public:
|
||||
ALStream* stream = nullptr;
|
||||
bool stopped = true;
|
||||
bool manuallyStopped = true;
|
||||
bool paused = false;
|
||||
uint source;
|
||||
duration_t duration = 0.0f;
|
||||
@@ -157,6 +162,8 @@ namespace audio {
|
||||
bool isRelative() const override;
|
||||
|
||||
int getPriority() const override;
|
||||
|
||||
bool isManuallyStopped() const override;
|
||||
};
|
||||
|
||||
class ALAudio : public Backend {
|
||||
|
||||
Reference in New Issue
Block a user