workaround arm hardware, timshift time in vfd

- thx DBoxOldie
This commit is contained in:
Frankenstone
2018-10-02 20:19:04 +02:00
committed by Thilo Graf
parent 7a796b445b
commit ccc243eafe
2 changed files with 13 additions and 0 deletions

View File

@@ -42,6 +42,8 @@ bool cPlayback::Open(playmode_t PlayMode)
} }
pm = PlayMode; pm = PlayMode;
got_vpts_ts = false;
vpts_ts = 0;
fn_ts = ""; fn_ts = "";
fn_xml = ""; fn_xml = "";
last_size = 0; last_size = 0;
@@ -448,6 +450,15 @@ bool cPlayback::GetPosition(int &position, int &duration)
} }
else else
{ {
/* workaround for crazy vpts value during timeshift */
if (!got_vpts_ts && pm == PLAYMODE_TS)
{
vpts_ts = vpts;
got_vpts_ts = true;
}
if (got_vpts_ts)
vpts -= vpts_ts;
/* end workaround */
/* len is in nanoseconds. we have 90 000 pts per second. */ /* len is in nanoseconds. we have 90 000 pts per second. */
position = vpts / 90; position = vpts / 90;
} }

View File

@@ -20,10 +20,12 @@ class cPlayback
bool enabled; bool enabled;
bool playing, first; bool playing, first;
bool no_probe; bool no_probe;
bool got_vpts_ts;
int nPlaybackSpeed; int nPlaybackSpeed;
int mAudioStream; int mAudioStream;
int mSubtitleStream; int mSubtitleStream;
int mTeletextStream; int mTeletextStream;
int64_t vpts_ts;
bool Stop(void); bool Stop(void);
bool decoders_closed; bool decoders_closed;
playmode_t pm; playmode_t pm;