From fc14387defe2abbb461ab1083e6173ef38c1a32c Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sun, 21 Sep 2014 17:34:30 +0200 Subject: [PATCH] fix timeshift (thx dbo) Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/18814b385a4a2dd69a8979ea364c8c0bcb0848b7 Author: TangoCash Date: 2014-09-21 (Sun, 21 Sep 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libspark/playback_libeplayer3.cpp | 11 ++++++----- libspark/playback_libeplayer3.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libspark/playback_libeplayer3.cpp b/libspark/playback_libeplayer3.cpp index 84efe2b..b095ca1 100644 --- a/libspark/playback_libeplayer3.cpp +++ b/libspark/playback_libeplayer3.cpp @@ -1,3 +1,4 @@ +#define __USE_FILE_OFFSET64 1 #include #include #include @@ -73,8 +74,8 @@ bool cPlayback::Start(char *filename, int vpid, int vtype, int apid, int ac3, in if (player->Open(file.c_str(), no_probe)) { if (pm == PLAYMODE_TS) { - struct stat s; - if (!stat(file.c_str(), &s)) + struct stat64 s; + if (!stat64(file.c_str(), &s)) last_size = s.st_size; ret = true; videoDecoder->Stop(false); @@ -209,12 +210,12 @@ bool cPlayback::GetPosition(int &position, int &duration) /* hack: if the file is growing (timeshift), then determine its length * by comparing the mtime with the mtime of the xml file */ if (pm == PLAYMODE_TS) { - struct stat s; - if (!stat(fn_ts.c_str(), &s)) { + struct stat64 s; + if (!stat64(fn_ts.c_str(), &s)) { if (!playing || last_size != s.st_size) { last_size = s.st_size; time_t curr_time = s.st_mtime; - if (!stat(fn_xml.c_str(), &s)) { + if (!stat64(fn_xml.c_str(), &s)) { duration = (curr_time - s.st_mtime) * 1000; if (!playing) return true; diff --git a/libspark/playback_libeplayer3.h b/libspark/playback_libeplayer3.h index 08186d9..efa1a23 100644 --- a/libspark/playback_libeplayer3.h +++ b/libspark/playback_libeplayer3.h @@ -26,7 +26,7 @@ class cPlayback playmode_t pm; std::string fn_ts; std::string fn_xml; - off_t last_size; + off64_t last_size; int init_jump; Player *player; const char *(*ProgramSelectionCallback)(void *, std::vector &keys, std::vector &values);