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() ...@@ -197,6 +197,8 @@ void SeekSlider::updatePos()
void SeekSlider::updateBuffering( float f_buffering_ ) void SeekSlider::updateBuffering( float f_buffering_ )
{ {
if ( f_buffering_ < f_buffering )
bufferingStart = QTime::currentTime();
f_buffering = f_buffering_; f_buffering = f_buffering_;
repaint(); repaint();
} }
...@@ -386,7 +388,10 @@ void SeekSlider::paintEvent( QPaintEvent *ev ) ...@@ -386,7 +388,10 @@ void SeekSlider::paintEvent( QPaintEvent *ev )
{ {
SeekStyle::SeekStyleOption option; SeekStyle::SeekStyleOption option;
option.initFrom( this ); option.initFrom( this );
option.buffering = f_buffering; if ( QTime::currentTime() > bufferingStart.addSecs( 1 ) )
option.buffering = f_buffering;
else
option.buffering = 1.0;
option.length = inputLength; option.length = inputLength;
option.animate = ( animHandle->state() == QAbstractAnimation::Running option.animate = ( animHandle->state() == QAbstractAnimation::Running
|| hideHandleTimer->isActive() ); || hideHandleTimer->isActive() );
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <QSlider> #include <QSlider>
#include <QPainter> #include <QPainter>
#include <QTime>
#define MSTRTIME_MAX_SIZE 22 #define MSTRTIME_MAX_SIZE 22
...@@ -85,6 +86,7 @@ private: ...@@ -85,6 +86,7 @@ private:
QTimer *seekLimitTimer; QTimer *seekLimitTimer;
TimeTooltip *mTimeTooltip; TimeTooltip *mTimeTooltip;
float f_buffering; float f_buffering;
QTime bufferingStart;
SeekPoints* chapters; SeekPoints* chapters;
bool b_classic; bool b_classic;
bool b_seekable; 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