summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranbr <vdr07@deltab.de>2012-01-11 21:44:44 +0100
committeranbr <vdr07@deltab.de>2012-01-11 21:44:44 +0100
commit84e7f87989e3447b4e6a467ce218ea2149048064 (patch)
tree34444d8bd5daf04b75416b98a96c1db080059d1a
parent84f3b03fa988080ce45ede8034f69fd940ef2ef4 (diff)
downloadxxv-84e7f87989e3447b4e6a467ce218ea2149048064.tar.gz
xxv-84e7f87989e3447b4e6a467ce218ea2149048064.tar.bz2
vdr2jpeg read gop failed on large files
-rw-r--r--contrib/vdr2jpeg/gop.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/contrib/vdr2jpeg/gop.cpp b/contrib/vdr2jpeg/gop.cpp
index 56f44e2..b26e19c 100644
--- a/contrib/vdr2jpeg/gop.cpp
+++ b/contrib/vdr2jpeg/gop.cpp
@@ -417,7 +417,7 @@ bool handleTmpfile(const std::string & szTmpBase, const std::string & szOutPath,
}
-bool ReadGOP(const std::string & szFile, int nBegin, int nLength, char *pMem )
+bool ReadGOP(const std::string & szFile, off_t nBegin, off_t nLength, char *pMem )
{
std::ifstream f(szFile.c_str(),
std::ifstream::in | std::ifstream::binary);
@@ -439,12 +439,18 @@ bool ReadGOP(const std::string & szFile, int nBegin, int nLength, char *pMem )
if(nBegin != 0) {
f.seekg(nBegin, std::ifstream::beg); // Seek to I-Frame
}
+#ifdef DEBUG
+ std::cerr << "Seek file : " << szFile << " to "<< nBegin << std::endl;
+#endif
f.read(pMem, nLength);
if (f.gcount() != nLength) {
std::cerr << "Can't read all from file : " << szFile << std::endl;
return false;
}
+#ifdef DEBUG
+ std::cerr << "Read file : " << szFile << " length "<< nLength << std::endl;
+#endif
return true;
}