mirror of
https://github.com/mpv-player/mpv
synced 2024-12-25 08:12:17 +00:00
Limit Gui redraw rate.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13673 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
b9e2410e04
commit
4107fec833
@ -26,6 +26,7 @@
|
|||||||
#include "../../libmpdemux/stheader.h"
|
#include "../../libmpdemux/stheader.h"
|
||||||
#include "../../codec-cfg.h"
|
#include "../../codec-cfg.h"
|
||||||
|
|
||||||
|
#define GUI_REDRAW_WAIT 375
|
||||||
|
|
||||||
#include "play.h"
|
#include "play.h"
|
||||||
#include "widgets.h"
|
#include "widgets.h"
|
||||||
@ -76,6 +77,7 @@ void mplMainDraw( void )
|
|||||||
extern void exit_player(char* how);
|
extern void exit_player(char* how);
|
||||||
extern int vcd_track;
|
extern int vcd_track;
|
||||||
extern int osd_visible;
|
extern int osd_visible;
|
||||||
|
static unsigned last_redraw_time = 0;
|
||||||
|
|
||||||
void mplEventHandling( int msg,float param )
|
void mplEventHandling( int msg,float param )
|
||||||
{
|
{
|
||||||
@ -329,6 +331,15 @@ set_volume:
|
|||||||
|
|
||||||
// --- timer events
|
// --- timer events
|
||||||
case evRedraw:
|
case evRedraw:
|
||||||
|
{
|
||||||
|
unsigned now = GetTimerMS();
|
||||||
|
extern int mplPBFade;
|
||||||
|
if ((now > last_redraw_time) &&
|
||||||
|
(now < last_redraw_time + GUI_REDRAW_WAIT) &&
|
||||||
|
!mplPBFade)
|
||||||
|
break;
|
||||||
|
last_redraw_time = now;
|
||||||
|
}
|
||||||
mplMainRender=1;
|
mplMainRender=1;
|
||||||
wsPostRedisplay( &appMPlayer.mainWindow );
|
wsPostRedisplay( &appMPlayer.mainWindow );
|
||||||
wsPostRedisplay( &appMPlayer.barWindow );
|
wsPostRedisplay( &appMPlayer.barWindow );
|
||||||
|
Loading…
Reference in New Issue
Block a user