From 6978289456be8754439c38cba36612f4593573e9 Mon Sep 17 00:00:00 2001 From: Frankenstone Date: Tue, 2 Oct 2018 20:19:04 +0200 Subject: [PATCH] workaround arm hardware, timshift time in vfd - thx DBoxOldie Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/0bdb479cfd24ed659fdfb0595ae2b3c239eeac95 Author: Frankenstone Date: 2018-10-02 (Tue, 02 Oct 2018) ------------------ This commit was generated by Migit --- libarmbox/playback_libeplayer3.cpp | 11 +++++++++++ libarmbox/playback_libeplayer3.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/libarmbox/playback_libeplayer3.cpp b/libarmbox/playback_libeplayer3.cpp index 78c21a5..8a3cf8f 100644 --- a/libarmbox/playback_libeplayer3.cpp +++ b/libarmbox/playback_libeplayer3.cpp @@ -42,6 +42,8 @@ bool cPlayback::Open(playmode_t PlayMode) } pm = PlayMode; + got_vpts_ts = false; + vpts_ts = 0; fn_ts = ""; fn_xml = ""; last_size = 0; @@ -448,6 +450,15 @@ bool cPlayback::GetPosition(int &position, int &duration) } 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. */ position = vpts / 90; } diff --git a/libarmbox/playback_libeplayer3.h b/libarmbox/playback_libeplayer3.h index 0709384..3829762 100644 --- a/libarmbox/playback_libeplayer3.h +++ b/libarmbox/playback_libeplayer3.h @@ -20,10 +20,12 @@ class cPlayback bool enabled; bool playing, first; bool no_probe; + bool got_vpts_ts; int nPlaybackSpeed; int mAudioStream; int mSubtitleStream; int mTeletextStream; + int64_t vpts_ts; bool Stop(void); bool decoders_closed; playmode_t pm;