mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-18 20:34:39 +01:00
Take the buffer duration into account when deciding when to preload the next
song for gapless playback.
This commit is contained in:
parent
ff71138079
commit
90898bd255
@ -616,7 +616,10 @@ void GstEngine::timerEvent(QTimerEvent* e) {
|
||||
const qint64 remaining = current_length - current_position;
|
||||
|
||||
const qint64 fudge = kTimerIntervalNanosec + 100 * kNsecPerMsec; // Mmm fudge
|
||||
const qint64 gap = autocrossfade_enabled_ ? fadeout_duration_nanosec_ : kPreloadGapNanosec;
|
||||
const qint64 gap = buffer_duration_nanosec_ + (
|
||||
autocrossfade_enabled_ ?
|
||||
fadeout_duration_nanosec_ :
|
||||
kPreloadGapNanosec);
|
||||
|
||||
// only if we know the length of the current stream...
|
||||
if(current_length > 0) {
|
||||
|
@ -158,9 +158,9 @@ class GstEngine : public Engine::Base, public BufferConsumer {
|
||||
static QUrl FixupUrl(const QUrl& url);
|
||||
|
||||
private:
|
||||
static const int kTimerIntervalNanosec = 1000 * kNsecPerMsec; // 1s
|
||||
static const int kPreloadGapNanosec = 1000 * kNsecPerMsec; // 1s
|
||||
static const int kSeekDelayNanosec = 100 * kNsecPerMsec; // 100msec
|
||||
static const qint64 kTimerIntervalNanosec = 1000 * kNsecPerMsec; // 1s
|
||||
static const qint64 kPreloadGapNanosec = 1000 * kNsecPerMsec; // 1s
|
||||
static const qint64 kSeekDelayNanosec = 100 * kNsecPerMsec; // 100msec
|
||||
|
||||
static const char* kHypnotoadPipeline;
|
||||
static const char* kEnterprisePipeline;
|
||||
|
Loading…
Reference in New Issue
Block a user