summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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
4 files changed, 13 insertions, 6 deletions
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 ())) {