From 3d3e169f1e2d5f47dd0151f46d77a77ba142aff3 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 5 Feb 2014 13:08:35 +0400 Subject: [PATCH] driver/record.cpp: try to flush hdd buffers, if hdd is in standby at record start --- src/driver/record.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 5a4bf3171..088e92e35 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -152,6 +152,7 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel) hintBox.paint(); tsfile = std::string(filename) + ".ts"; + bool standby = hdd_get_standby(Directory.c_str()); printf("%s: file %s vpid %x apid %x\n", __FUNCTION__, tsfile.c_str(), allpids.PIDs.vpid, apids[0]); @@ -202,6 +203,8 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel) } psi.genpsi(fd); + if (standby) + hdd_flush(tsfile.c_str()); #if 0 if ((StreamPmtPid) && (allpids.PIDs.pmtpid != 0) && (numpids < REC_MAX_APIDS))