mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
fix timeshift (thx dbo)
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
#define __USE_FILE_OFFSET64 1
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -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 (player->Open(file.c_str(), no_probe)) {
|
||||||
if (pm == PLAYMODE_TS) {
|
if (pm == PLAYMODE_TS) {
|
||||||
struct stat s;
|
struct stat64 s;
|
||||||
if (!stat(file.c_str(), &s))
|
if (!stat64(file.c_str(), &s))
|
||||||
last_size = s.st_size;
|
last_size = s.st_size;
|
||||||
ret = true;
|
ret = true;
|
||||||
videoDecoder->Stop(false);
|
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
|
/* hack: if the file is growing (timeshift), then determine its length
|
||||||
* by comparing the mtime with the mtime of the xml file */
|
* by comparing the mtime with the mtime of the xml file */
|
||||||
if (pm == PLAYMODE_TS) {
|
if (pm == PLAYMODE_TS) {
|
||||||
struct stat s;
|
struct stat64 s;
|
||||||
if (!stat(fn_ts.c_str(), &s)) {
|
if (!stat64(fn_ts.c_str(), &s)) {
|
||||||
if (!playing || last_size != s.st_size) {
|
if (!playing || last_size != s.st_size) {
|
||||||
last_size = s.st_size;
|
last_size = s.st_size;
|
||||||
time_t curr_time = s.st_mtime;
|
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;
|
duration = (curr_time - s.st_mtime) * 1000;
|
||||||
if (!playing)
|
if (!playing)
|
||||||
return true;
|
return true;
|
||||||
|
@@ -26,7 +26,7 @@ class cPlayback
|
|||||||
playmode_t pm;
|
playmode_t pm;
|
||||||
std::string fn_ts;
|
std::string fn_ts;
|
||||||
std::string fn_xml;
|
std::string fn_xml;
|
||||||
off_t last_size;
|
off64_t last_size;
|
||||||
int init_jump;
|
int init_jump;
|
||||||
Player *player;
|
Player *player;
|
||||||
const char *(*ProgramSelectionCallback)(void *, std::vector<std::string> &keys, std::vector<std::string> &values);
|
const char *(*ProgramSelectionCallback)(void *, std::vector<std::string> &keys, std::vector<std::string> &values);
|
||||||
|
Reference in New Issue
Block a user