Permalink
Browse files

Merge pull request #2314 from FernetMenta/chapterseek

fix seeking chapter
  • Loading branch information...
2 parents 61be6bc + 4581fa8 commit 288d0ffc3f45f6948e2953151075517d9256f971 @FernetMenta FernetMenta committed Mar 1, 2013
Showing with 13 additions and 8 deletions.
  1. +13 −6 xbmc/cores/dvdplayer/DVDPlayer.cpp
  2. +0 −2 xbmc/cores/dvdplayer/DVDPlayer.h
@@ -1717,7 +1717,17 @@ void CDVDPlayer::UpdateTimestamps(CCurrentStream& current, DemuxPacket* pPacket)
|| abs(current.dts - current.dts_state) > DVD_MSEC_TO_TIME(200))
{
current.dts_state = current.dts;
- SendPlayerMessage(new CDVDMsgType<SPlayerState>(CDVDMsg::PLAYER_DISPLAYTIME, m_StateInput), current.player);
+ if (current.inited)
+ {
+ // make sure we send no outdated state to a/v players
+ UpdatePlayState(0);
+ SendPlayerMessage(new CDVDMsgType<SPlayerState>(CDVDMsg::PLAYER_DISPLAYTIME, m_StateInput), current.player);
+ }
+ else
+ {
+ CSingleLock lock(m_StateSection);
+ m_State = m_StateInput;
+ }
}
}
@@ -3859,10 +3869,8 @@ int CDVDPlayer::AddSubtitleFile(const std::string& filename, const std::string&
void CDVDPlayer::UpdatePlayState(double timeout)
{
- if((m_StateInput.timestamp != 0)
- && (m_StateInput.timestamp + DVD_MSEC_TO_TIME(timeout) > CDVDClock::GetAbsoluteClock())
- && (m_StateInput.dts != DVD_NOPTS_VALUE)
- && (abs(m_StateInput.dts - m_StateInput.dts_state) < DVD_MSEC_TO_TIME(timeout)))
+ if(m_StateInput.timestamp != 0
+ && m_StateInput.timestamp + DVD_MSEC_TO_TIME(timeout) > CDVDClock::GetAbsoluteClock())
return;
SPlayerState state(m_StateInput);
@@ -3988,7 +3996,6 @@ void CDVDPlayer::UpdatePlayState(double timeout)
state.cache_bytes = 0;
state.timestamp = CDVDClock::GetAbsoluteClock();
- state.dts_state = state.dts;
CSingleLock lock(m_StateSection);
m_StateInput = state;
@@ -424,7 +424,6 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer
time_offset = 0;
time_src = ETIMESOURCE_CLOCK;
dts = DVD_NOPTS_VALUE;
- dts_state = DVD_NOPTS_VALUE;
player_state = "";
chapter = 0;
chapter_name = "";
@@ -450,7 +449,6 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer
double time_total; // total playback time
ETimeSource time_src; // current time source
double dts; // last known dts
- double dts_state; // dts of last update
std::string player_state; // full player state

0 comments on commit 288d0ff

Please sign in to comment.