From d94f874259cd4a18a6f3e8294f6ff512bd22daf4 Mon Sep 17 00:00:00 2001 From: snt Date: Wed, 15 May 2024 19:28:30 +0200 Subject: [PATCH] =?UTF-8?q?resuelve=20glitch=20cuando=20no=20empieza=20en?= =?UTF-8?q?=20cero,=20parece=20que=20se=20queda=20en=20alguna=20cach=C3=A9?= =?UTF-8?q?=20intermedia=20unos=20frames=20guardados=20que=20no=20s=C3=A9?= =?UTF-8?q?=20flushear...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/defines.h | 2 +- src/miniaudioengine.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/defines.h b/src/defines.h index 68c72f5..23d3322 100644 --- a/src/defines.h +++ b/src/defines.h @@ -1,7 +1,7 @@ #ifndef DEFINES_H #define DEFINES_H -#define VERSION "LibreMediaServerAudio 0.2.0 Antigona Release" +#define VERSION "LibreMediaServerAudio v0.2.0 Antigona" #define COPYRIGHT "(C) 2014-2024 Santi NoreƱa " #define LICENSE "GPL 3 Licensed. See LICENSE.txt." #define DEFAULT_FILE "lms-audio.xlm" diff --git a/src/miniaudioengine.cpp b/src/miniaudioengine.cpp index 9dbd3c8..6bdeb2d 100644 --- a/src/miniaudioengine.cpp +++ b/src/miniaudioengine.cpp @@ -376,7 +376,10 @@ ma_result MiniAudioEngine::playbackChanged(int layer, Status status) ma_sound_set_stop_time_in_milliseconds(&m_currentSound[layer], ~(ma_uint64)0); ma_sound_set_looping(&m_currentSound[layer], loop); result = ma_sound_start(&m_currentSound[layer]); - //this->volChanged(layer, m_currentLayerValues[layer].vol); // glitch when seek to cursor, how flush the audio buffer? + if (m_currentLayerValues[layer].cursor != 0) { + usleep(1000 * 50); // Avoid small glitch at start, how to flush the cached buffers in audio pipe line? + } + this->volChanged(layer, m_currentLayerValues[layer].vol); default: break; }