Commit 0be748f9 authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: SeekSlider: don't show buffering < 1s

parent 6ea38362
......@@ -197,6 +197,8 @@ void SeekSlider::updatePos()
void SeekSlider::updateBuffering( float f_buffering_ )
{
if ( f_buffering_ < f_buffering )
bufferingStart = QTime::currentTime();
f_buffering = f_buffering_;
repaint();
}
......@@ -386,7 +388,10 @@ void SeekSlider::paintEvent( QPaintEvent *ev )
{
SeekStyle::SeekStyleOption option;
option.initFrom( this );
if ( QTime::currentTime() > bufferingStart.addSecs( 1 ) )
option.buffering = f_buffering;
else
option.buffering = 1.0;
option.length = inputLength;
option.animate = ( animHandle->state() == QAbstractAnimation::Running
|| hideHandleTimer->isActive() );
......
......@@ -36,6 +36,7 @@
#include <QSlider>
#include <QPainter>
#include <QTime>
#define MSTRTIME_MAX_SIZE 22
......@@ -85,6 +86,7 @@ private:
QTimer *seekLimitTimer;
TimeTooltip *mTimeTooltip;
float f_buffering;
QTime bufferingStart;
SeekPoints* chapters;
bool b_classic;
bool b_seekable;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment