Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
93eeed79
Commit
93eeed79
authored
Apr 03, 2009
by
Ludovic Fauvet
Browse files
Don't flood the GUI with timeChanged events
parent
5962391b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/LibVLCpp/VLCMediaPlayer.cpp
View file @
93eeed79
...
...
@@ -64,7 +64,7 @@ void MediaPlayer::callbacks( const libvlc_event_t* ev
// case libvlc_MediaPlayerEndReached:
// case libvlc_MediaPlayerEncounteredError:
case
libvlc_MediaPlayerTimeChanged
:
self
->
emit
timeChanged
();
self
->
timeChanged
Filter
();
break
;
// case libvlc_MediaPlayerPositionChanged:
// case libvlc_MediaPlayerSeekableChanged:
...
...
@@ -158,3 +158,14 @@ void MediaPlayer::setDrawable( uint32_t drawable
{
libvlc_media_player_set_xwindow
(
m_internalPtr
,
drawable
,
m_ex
);
}
void
MediaPlayer
::
timeChangedFilter
()
{
// Don't flood the gui with too many signals
qint64
currentTime
=
getTime
()
/
100
;
static
qint64
lastTime
=
0
;
if
(
currentTime
!=
lastTime
)
emit
timeChanged
();
lastTime
=
currentTime
;
}
src/LibVLCpp/VLCMediaPlayer.h
View file @
93eeed79
...
...
@@ -53,6 +53,7 @@ namespace LibVLCpp
private:
static
void
callbacks
(
const
libvlc_event_t
*
event
,
void
*
self
);
void
timeChangedFilter
();
Exception
m_ex
;
libvlc_event_manager_t
*
p_em
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment