Permalink
Browse files

Improve performance in the MythPlayer event loop.

Don't call GetCurrentFrameCount() until it's actually needed, to avoid
making a protocol request on every frame during playback of live TV or
in-progress recordings.
  • Loading branch information...
stichnot committed Jan 29, 2013
1 parent 690f333 commit 59f6a68d97e4d24a1ac3fdfe24637acb8213bfed
Showing with 2 additions and 1 deletion.
  1. +2 −1 mythtv/libs/libmythtv/mythplayer.cpp
@@ -2800,7 +2800,6 @@ void MythPlayer::EventStart(void)
void MythPlayer::EventLoop(void)
{
uint64_t frameCount = GetCurrentFrameCount();
// recreate the osd if a reinit was triggered by another thread
if (reinit_osd)
ReinitOSD();
@@ -2990,6 +2989,7 @@ void MythPlayer::EventLoop(void)
{
QString msg;
uint64_t jumpto = 0;
uint64_t frameCount = GetCurrentFrameCount();
// XXX CommBreakMap should use duration map not video_frame_rate
bool jump = commBreakMap.DoSkipCommercials(jumpto, framesPlayed,
video_frame_rate,
@@ -3009,6 +3009,7 @@ void MythPlayer::EventLoop(void)
(kCommSkipOff != commBreakMap.GetAutoCommercialSkip()))
{
QString msg;
uint64_t frameCount = GetCurrentFrameCount();
// XXX CommBreakMap should use duration map not video_frame_rate
bool jump = commBreakMap.AutoCommercialSkip(jumpto, framesPlayed,
video_frame_rate,

0 comments on commit 59f6a68

Please sign in to comment.