diff --git a/mythtv/libs/libmythtv/decoderbase.h b/mythtv/libs/libmythtv/decoderbase.h
index a736f23dc7a..87eba8ee22c 100644
|
a
|
b
|
class DecoderBase
|
| 204 | 204 | virtual void UpdateFramesPlayed(void); |
| 205 | 205 | long long GetFramesRead(void) const { return m_framesRead; } |
| 206 | 206 | long long GetFramesPlayed(void) const { return m_framesPlayed; } |
| | 207 | void SetFramesPlayed(long long newValue) {m_framesPlayed = newValue;} |
| 207 | 208 | |
| 208 | 209 | virtual QString GetCodecDecoderName(void) const = 0; |
| 209 | 210 | virtual QString GetRawEncodingType(void) { return QString(); } |
diff --git a/mythtv/libs/libmythtv/mythplayer.cpp b/mythtv/libs/libmythtv/mythplayer.cpp
index db421c7225b..7f12f91e427 100644
|
a
|
b
|
MythPlayer::MythPlayer(PlayerFlags flags)
|
| 225 | 225 | numdroppedframes(0), |
| 226 | 226 | prior_audiotimecode(0), |
| 227 | 227 | prior_videotimecode(0), |
| | 228 | m_timeOffsetBase(0), |
| 228 | 229 | // LiveTVChain stuff |
| 229 | 230 | m_tv(nullptr), isDummy(false), |
| 230 | 231 | // Counter for buffering messages |
| … |
… |
void MythPlayer::AVSync2(VideoFrame *buffer)
|
| 2231 | 2232 | maxtcval = 0; |
| 2232 | 2233 | maxtcframes = 0; |
| 2233 | 2234 | numdroppedframes = 0; |
| | 2235 | m_timeOffsetBase = TranslatePositionFrameToMs(framesPlayed, false) - videotimecode; |
| 2234 | 2236 | } |
| 2235 | 2237 | |
| 2236 | 2238 | if (videotimecode == 0) |
| … |
… |
void MythPlayer::AVSync2(VideoFrame *buffer)
|
| 2252 | 2254 | else |
| 2253 | 2255 | framedue = unow + frame_interval / 2; |
| 2254 | 2256 | |
| | 2257 | // recalculate framesPlayed to conform to actual time code. |
| | 2258 | framesPlayed = TranslatePositionMsToFrame(videotimecode + m_timeOffsetBase, false); |
| | 2259 | decoder->SetFramesPlayed(framesPlayed); |
| | 2260 | |
| 2255 | 2261 | lateness = unow - framedue; |
| 2256 | 2262 | dropframe = false; |
| 2257 | 2263 | if (lateness > 30000) |
diff --git a/mythtv/libs/libmythtv/mythplayer.h b/mythtv/libs/libmythtv/mythplayer.h
index 4b295af28fe..088da8a04ea 100644
|
a
|
b
|
class MTV_PUBLIC MythPlayer
|
| 858 | 858 | int numdroppedframes; // number of consecutive dropped frames. |
| 859 | 859 | int64_t prior_audiotimecode; // time code from prior frame |
| 860 | 860 | int64_t prior_videotimecode; // time code from prior frame |
| | 861 | int64_t m_timeOffsetBase; |
| 861 | 862 | |
| 862 | 863 | // LiveTV |
| 863 | 864 | TV *m_tv; |