1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed getting the file size and number of frames of ongoing recordings

This commit is contained in:
Klaus Schmidinger 2012-09-06 10:07:25 +02:00
parent f7a1954fe3
commit 2ceb19e566
3 changed files with 9 additions and 6 deletions

View File

@ -7191,7 +7191,7 @@ Video Disk Recorder Revision History
turn on adding the source character to channel names whenever they are displayed turn on adding the source character to channel names whenever they are displayed
(suggested by Ludi Kaleni). (suggested by Ludi Kaleni).
2012-09-05: Version 1.7.30 2012-09-06: Version 1.7.30
- Fixed sorting recordings in the top level video directory. - Fixed sorting recordings in the top level video directory.
- Fixed handling control characters in SI data in case of UTF-8 encoded strings - Fixed handling control characters in SI data in case of UTF-8 encoded strings
@ -7223,3 +7223,6 @@ Video Disk Recorder Revision History
given in the -v option if only -v and no -c is given. given in the -v option if only -v and no -c is given.
- Fixed a long delay at the end when replaying a recording that has stopped recording - Fixed a long delay at the end when replaying a recording that has stopped recording
less than an hour ago (typically time shift mode or a freshly edited recording). less than an hour ago (typically time shift mode or a freshly edited recording).
- Fixed getting the file size and number of frames of ongoing recordings (only the
timestamp of the recording's directory was checked, while it should have been that
of the index file).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: recording.c 2.59 2012/09/05 11:45:55 kls Exp $ * $Id: recording.c 2.60 2012/09/06 09:57:31 kls Exp $
*/ */
#include "recording.h" #include "recording.h"
@ -1067,7 +1067,7 @@ int cRecording::NumFrames(void) const
{ {
if (numFrames < 0) { if (numFrames < 0) {
int nf = cIndexFile::GetLength(FileName(), IsPesRecording()); int nf = cIndexFile::GetLength(FileName(), IsPesRecording());
if (time(NULL) - LastModifiedTime(FileName()) < MININDEXAGE) if (time(NULL) - LastModifiedTime(cIndexFile::IndexFileName(FileName(), IsPesRecording())) < MININDEXAGE)
return nf; // check again later for ongoing recordings return nf; // check again later for ongoing recordings
numFrames = nf; numFrames = nf;
} }
@ -1086,7 +1086,7 @@ int cRecording::FileSizeMB(void) const
{ {
if (fileSizeMB < 0) { if (fileSizeMB < 0) {
int fs = DirSizeMB(FileName()); int fs = DirSizeMB(FileName());
if (time(NULL) - LastModifiedTime(FileName()) < MININDEXAGE) if (time(NULL) - LastModifiedTime(cIndexFile::IndexFileName(FileName(), IsPesRecording())) < MININDEXAGE)
return fs; // check again later for ongoing recordings return fs; // check again later for ongoing recordings
fileSizeMB = fs; fileSizeMB = fs;
} }

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: recording.h 2.35 2012/09/05 11:25:33 kls Exp $ * $Id: recording.h 2.36 2012/09/06 09:59:11 kls Exp $
*/ */
#ifndef __RECORDING_H #ifndef __RECORDING_H
@ -280,7 +280,6 @@ private:
static void AddToIndexList(const cIndexFile *IndexFile); static void AddToIndexList(const cIndexFile *IndexFile);
static void RemoveFromIndexList(const cIndexFile *IndexFile); static void RemoveFromIndexList(const cIndexFile *IndexFile);
static bool IsInIndexList(const cIndexFile *IndexFile); static bool IsInIndexList(const cIndexFile *IndexFile);
static cString IndexFileName(const char *FileName, bool IsPesRecording);
void ConvertFromPes(tIndexTs *IndexTs, int Count); void ConvertFromPes(tIndexTs *IndexTs, int Count);
void ConvertToPes(tIndexTs *IndexTs, int Count); void ConvertToPes(tIndexTs *IndexTs, int Count);
bool CatchUp(int Index = -1); bool CatchUp(int Index = -1);
@ -300,6 +299,7 @@ public:
static int GetLength(const char *FileName, bool IsPesRecording = false); static int GetLength(const char *FileName, bool IsPesRecording = false);
///< Calculates the recording length (number of frames) without actually reading the index file. ///< Calculates the recording length (number of frames) without actually reading the index file.
///< Returns -1 in case of error. ///< Returns -1 in case of error.
static cString IndexFileName(const char *FileName, bool IsPesRecording);
}; };
class cFileName { class cFileName {