Skip to content

Commit

Permalink
Improve performance in the MythPlayer event loop.
Browse files Browse the repository at this point in the history
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 59f6a68
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mythtv/libs/libmythtv/mythplayer.cpp
Expand Up @@ -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();
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 59f6a68

Please sign in to comment.