Skip to content

Commit

Permalink
Prevent VideoSync from setting up in Destructor
Browse files Browse the repository at this point in the history
  • Loading branch information
peak3d committed Jan 15, 2020
1 parent f32da01 commit 568ae15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xbmc/cores/VideoPlayer/VideoReferenceClock.cpp
Expand Up @@ -37,6 +37,7 @@ CVideoReferenceClock::CVideoReferenceClock() : CThread("RefClock")

CVideoReferenceClock::~CVideoReferenceClock()
{
m_destructing = true;
m_vsyncStopEvent.Set();
StopThread();
}
Expand Down Expand Up @@ -108,7 +109,7 @@ void CVideoReferenceClock::Process()
m_pVideoSync.reset();
}

if (!SetupSuccess)
if (!SetupSuccess || m_destructing)
break;
}
}
Expand Down
2 changes: 2 additions & 0 deletions xbmc/cores/VideoPlayer/VideoReferenceClock.h
Expand Up @@ -37,6 +37,8 @@ class CVideoReferenceClock : CThread
int64_t TimeOfNextVblank() const;
static void CBUpdateClock(int NrVBlanks, uint64_t time, void *clock);

bool m_destructing = false;

int64_t m_CurrTime; //the current time of the clock when using vblank as clock source
int64_t m_LastIntTime; //last interpolated clock value, to make sure the clock doesn't go backwards
double m_CurrTimeFract; //fractional part that is lost due to rounding when updating the clock
Expand Down

0 comments on commit 568ae15

Please sign in to comment.