diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2009-01-24 13:16:43 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2009-01-24 13:16:43 +0100 |
commit | c5553f9187c6f16a4280e7299ec26328eaa0b398 (patch) | |
tree | a0644fa026db806817c514eef72d565274ac5f8c /recording.c | |
parent | a02868c90c1832879b1662398d10f1edebfaf59a (diff) | |
download | vdr-c5553f9187c6f16a4280e7299ec26328eaa0b398.tar.gz vdr-c5553f9187c6f16a4280e7299ec26328eaa0b398.tar.bz2 |
Fixed editing PES recordings
Diffstat (limited to 'recording.c')
-rw-r--r-- | recording.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/recording.c b/recording.c index 5dc1b308..9c7db99f 100644 --- a/recording.c +++ b/recording.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recording.c 2.7 2009/01/24 11:31:16 kls Exp $ + * $Id: recording.c 2.8 2009/01/24 13:11:04 kls Exp $ */ #include "recording.h" @@ -1432,6 +1432,19 @@ void cIndexFile::ConvertFromPes(tIndexTs *IndexTs, int Count) } } +void cIndexFile::ConvertToPes(tIndexTs *IndexTs, int Count) +{ + tIndexPes IndexPes; + while (Count-- > 0) { + IndexPes.offset = uint32_t(IndexTs->offset); + IndexPes.type = IndexTs->independent ? 1 : 2; // I_FRAME : "not I_FRAME" (exact frame type doesn't matter) + IndexPes.number = IndexTs->number; + IndexPes.reserved = 0; + memcpy(IndexTs, &IndexPes, sizeof(*IndexTs)); + IndexTs++; + } +} + bool cIndexFile::CatchUp(int Index) { // returns true unless something really goes wrong, so that 'index' becomes NULL @@ -1491,6 +1504,8 @@ bool cIndexFile::Write(bool Independent, uint16_t FileNumber, off_t FileOffset) { if (f >= 0) { tIndexTs i(FileOffset, Independent, FileNumber); + if (isPesRecording) + ConvertToPes(&i, 1); if (safe_write(f, &i, sizeof(i)) < 0) { LOG_ERROR_STR(fileName); close(f); |