Use _lseeki64() on Windows to seek in large files.
Fixes #576021.
#include <gst/gst.h>
#include <gst/base/gstcollectpads.h>
#include <gst/gst.h>
#include <gst/base/gstcollectpads.h>
+#ifdef G_OS_WIN32
+#include <io.h> /* lseek, open, close, read */
+#undef lseek
+#define lseek _lseeki64
+#undef off_t
+#define off_t guint64
+#endif
+
#include "gstqtmux.h"
GST_DEBUG_CATEGORY_STATIC (gst_qt_mux_debug);
#include "gstqtmux.h"
GST_DEBUG_CATEGORY_STATIC (gst_qt_mux_debug);
if (fflush (qtmux->fast_start_file))
goto flush_failed;
if (fflush (qtmux->fast_start_file))
goto flush_failed;
- if (fseek (qtmux->fast_start_file, 0, SEEK_SET))
+#ifdef HAVE_FSEEKO
+ if (fseeko (qtmux->fast_start_file, (off_t) 0, SEEK_SET) != 0)
+ goto seek_failed;
+#elif defined (G_OS_UNIX) || defined (G_OS_WIN32)
+ if (lseek (fileno (qtmux->fast_start_file), (off_t) 0,
+ SEEK_SET) == (off_t) - 1)
+#else
+ if (fseek (qtmux->fast_start_file, (long) 0, SEEK_SET) != 0)
+ goto seek_failed;
+#endif
/* hm, this could all take a really really long time,
* but there may not be another way to get moov atom first
/* hm, this could all take a really really long time,
* but there may not be another way to get moov atom first