From: Felix Domke Date: Thu, 24 May 2007 20:09:57 +0000 (+0000) Subject: in case of short reads, re-align with blocksize X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=commitdiff_plain;h=ae4d58285fffc667653197d17734d5018acef9d4 in case of short reads, re-align with blocksize --- diff --git a/lib/base/filepush.cpp b/lib/base/filepush.cpp index 1e5685c..2a894cf 100644 --- a/lib/base/filepush.cpp +++ b/lib/base/filepush.cpp @@ -174,6 +174,15 @@ void eFilePushThread::thread() } eDebug("eFilePushThread *read error* (%m) - not yet handled"); } + + /* a read might be mis-aligned in case of a short read. */ + int d = m_buf_end % m_blocksize; + if (d) + { + m_raw_source.lseek(-d, SEEK_CUR); + m_buf_end -= d; + } + if (m_buf_end == 0) { /* on EOF, try COMMITting once. */