Use _fseeki64 on Windows when handling content files.
authorCarl Hetherington <cth@carlh.net>
Sun, 5 Jan 2014 18:06:12 +0000 (18:06 +0000)
committerCarl Hetherington <cth@carlh.net>
Sun, 5 Jan 2014 18:06:12 +0000 (18:06 +0000)
ChangeLog
src/lib/cross.cc
src/lib/cross.h
src/lib/file_group.cc
src/lib/writer.cc

index f74a40a4c4d328b535d56ffa5077e9d66779321f..a77ea39d1714017d58166f1f914bf79ac9f9dfaa 100644 (file)
--- 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.
index 746b4f509c7e010a7c0203eda85bc155239af779..57b3f93b24d9dde847ff6fa123539526d6d259bb 100644 (file)
@@ -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 
+}
index 931e7d8900792612f5781fc44b0b44f494c6cf09..7e032e5a1c808006e0c35860f9be6522f358bc9b 100644 (file)
@@ -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);
index dfe336b8f87eae4a9a568251aa8c735316acb61f..80769545173308db30dbee8a91acc50dbecc272e 100644 (file)
@@ -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;
 }
 
index 414ea72ebb47425e55e9d4719e9819c453985b16..15732b131fefcf5dd076e2ca608cabdde15940d8 100644 (file)
@@ -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 ())) {