From ea01358b3bca9d55402ba632c95cdd6458abfdb3 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 22 Nov 2009 15:58:00 +0100 Subject: Version 1.7.10 - Updated the Italian OSD texts (thanks to Diego Pierotto). - Fixed wrong bracketing in cChannel::SubtitlingType() etc. (thanks to Rolf Ahrenberg). - Fixed not logging changes for channels that have no number (reported by Timothy D. Lenz). - Changed the project's URLs and email to tvdr.de. - Added Lithuanian language translations (thanks to Valdemaras Pipiras). - Updated Chinese language texts (thanks to Nan Feng). - Only checking DVB_API_VERSION to be >=5 in order to stay compileable in case the DVB API version number is increased (the API claims to always be backward compatible). - Fixed saving terminal settings when running in background (thanks to Manuel Reimer). - Fixed cFrameDetector::Analyze() to handle video streams where the frame type is not detectable from the first TS packet of a frame. - Fixed writing the PCR pid into the PMT in cPatPmtGenerator::GeneratePmt() (reported by Rene van den Braken). - Added Slovakian language texts (thanks to Milan Hrala). - Fixed EntriesOnSameFileSystem() to avoid using f_fsid, which may be 0 (thanks to Frank Schmirler). - Fixed starting a recording at an I-frame. - Fixed generating the index for recordings from channels that put a whole GOP into one payload unit. - The index file for TS recordings is now regenerated on-the-fly if a recording is replayed that has no index. This can also be used to re-create a broken index file by manually deleting the index file and then replaying the recording (at least until the index file has been generated). - The cRingBufferLinear::Read() function now returns -1 and sets errno to EAGAIN if the buffer is already full. - Fixed handling DVB subtitles for PES recordings (thanks to Rolf Ahrenberg). - Added the audio id to the call of PlayAudio() in cDevice::PlayTsAudio() (thanks to Andreas Schaefers). - Fixed references to old *.vdr file names in MANUAL (reported by Arthur Konovalov). - Reverted "Removed limitation to PAL resolution from SPU handling" because it cause nothing but trouble. Besides, the core VDR doesn't use this, anyway. - Fixed the default value for "Pause key handling" in the MANUAL (reported by Diego Pierotto). --- recorder.c | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) (limited to 'recorder.c') diff --git a/recorder.c b/recorder.c index 4e48a51..145d020 100644 --- a/recorder.c +++ b/recorder.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recorder.c 2.4 2009/05/23 12:18:25 kls Exp $ + * $Id: recorder.c 2.6 2009/11/21 15:58:12 kls Exp $ */ #include "recorder.h" @@ -30,7 +30,7 @@ cRecorder::cRecorder(const char *FileName, tChannelID ChannelID, int Priority, i SpinUpDisk(FileName); - ringBuffer = new cRingBufferLinear(RECORDERBUFSIZE, TS_SIZE * 2, true, "Recorder"); + ringBuffer = new cRingBufferLinear(RECORDERBUFSIZE, MIN_TS_PACKETS_FOR_FRAME_DETECTOR * TS_SIZE, true, "Recorder"); ringBuffer->SetTimeouts(0, 100); cChannel *Channel = Channels.GetByChannelID(ChannelID); int Pid = VPid; @@ -116,6 +116,7 @@ void cRecorder::Action(void) { time_t t = time(NULL); bool InfoWritten = false; + bool FirstIframeSeen = false; while (Running()) { int r; uchar *b = ringBuffer->Get(r); @@ -134,25 +135,28 @@ void cRecorder::Action(void) } InfoWritten = true; } - if (!NextFile()) - break; - if (index && frameDetector->NewFrame()) - index->Write(frameDetector->IndependentFrame(), fileName->Number(), fileSize); - if (frameDetector->IndependentFrame()) { - recordFile->Write(patPmtGenerator.GetPat(), TS_SIZE); - fileSize += TS_SIZE; - int Index = 0; - while (uchar *pmt = patPmtGenerator.GetPmt(Index)) { - recordFile->Write(pmt, TS_SIZE); - fileSize += TS_SIZE; - } - } - if (recordFile->Write(b, Count) < 0) { - LOG_ERROR_STR(fileName->Name()); - break; + if (FirstIframeSeen || frameDetector->IndependentFrame()) { + FirstIframeSeen = true; // start recording with the first I-frame + if (!NextFile()) + break; + if (index && frameDetector->NewFrame()) + index->Write(frameDetector->IndependentFrame(), fileName->Number(), fileSize); + if (frameDetector->IndependentFrame()) { + recordFile->Write(patPmtGenerator.GetPat(), TS_SIZE); + fileSize += TS_SIZE; + int Index = 0; + while (uchar *pmt = patPmtGenerator.GetPmt(Index)) { + recordFile->Write(pmt, TS_SIZE); + fileSize += TS_SIZE; + } + } + if (recordFile->Write(b, Count) < 0) { + LOG_ERROR_STR(fileName->Name()); + break; + } + fileSize += Count; + t = time(NULL); } - fileSize += Count; - t = time(NULL); } ringBuffer->Del(Count); } -- cgit v1.2.3