summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-01-05 18:06:12 +0000
committerCarl Hetherington <cth@carlh.net>2014-01-05 18:06:12 +0000
commitedafebffa42b9bc57408cc9540a7c15e4e4cab63 (patch)
tree1b170a86427b9671fc45e4a1317d5fd944eec674
parent8c23bbd8e6adcc83bd0d530aedf96df83302f878 (diff)
Use _fseeki64 on Windows when handling content files.
-rw-r--r--ChangeLog4
-rw-r--r--src/lib/cross.cc10
-rw-r--r--src/lib/cross.h1
-rw-r--r--src/lib/file_group.cc2
-rw-r--r--src/lib/writer.cc6
5 files changed, 17 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index f74a40a4c..a77ea39d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-01-05 Carl Hetherington <cth@carlh.net>
+
+ * Use _fseeki64 on Windows when reading content files.
+
2014-01-03 Carl Hetherington <cth@carlh.net>
* Version 1.56 released.
diff --git a/src/lib/cross.cc b/src/lib/cross.cc
index 746b4f509..57b3f93b2 100644
--- a/src/lib/cross.cc
+++ b/src/lib/cross.cc
@@ -288,3 +288,13 @@ fopen_boost (boost::filesystem::path p, string t)
return fopen (p.c_str(), t.c_str ());
#endif
}
+
+int
+dcpomatic_fseek (FILE* stream, int64_t offset, int whence)
+{
+#ifdef DCPOMATIC_WINDOWS
+ return _fseeki64 (stream, offset, whence);
+#else
+ return fseek (stream, offset, whence);
+#endif
+}
diff --git a/src/lib/cross.h b/src/lib/cross.h
index 931e7d890..7e032e5a1 100644
--- a/src/lib/cross.h
+++ b/src/lib/cross.h
@@ -34,3 +34,4 @@ extern boost::filesystem::path openssl_path ();
extern boost::filesystem::path app_contents ();
#endif
extern FILE * fopen_boost (boost::filesystem::path, std::string);
+extern int dcpomatic_fseek (FILE *, int64_t, int);
diff --git a/src/lib/file_group.cc b/src/lib/file_group.cc
index dfe336b8f..807695451 100644
--- a/src/lib/file_group.cc
+++ b/src/lib/file_group.cc
@@ -125,7 +125,7 @@ FileGroup::seek (int64_t pos, int whence) const
}
ensure_open_path (i);
- fseek (_current_file, sub_pos, SEEK_SET);
+ dcpomatic_fseek (_current_file, sub_pos, SEEK_SET);
return full_pos;
}
diff --git a/src/lib/writer.cc b/src/lib/writer.cc
index 414ea72eb..15732b131 100644
--- a/src/lib/writer.cc
+++ b/src/lib/writer.cc
@@ -448,11 +448,7 @@ Writer::check_existing_picture_mxf_frame (FILE* mxf, int f, Eyes eyes)
}
/* Read the data from the MXF and hash it */
-#ifdef DCPOMATIC_WINDOWS
- _fseeki64 (mxf, info.offset, SEEK_SET);
-#else
- fseek (mxf, info.offset, SEEK_SET);
-#endif
+ dcpomatic_fseek (mxf, info.offset, SEEK_SET);
EncodedData data (info.size);
size_t const read = fread (data.data(), 1, data.size(), mxf);
if (read != static_cast<size_t> (data.size ())) {