Merge "Fix mingw build."
This commit is contained in:
commit
4600f5b4a2
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#ifdef _WIN32
|
#ifdef _MSC_VER
|
||||||
#define _CRT_RAND_S
|
#define _CRT_RAND_S
|
||||||
#endif
|
#endif
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
@ -669,11 +669,16 @@ void GetVersion(int32* major, int32* minor, int32* build, int32* revision) {
|
|||||||
|
|
||||||
mkvmuxer::uint64 mkvmuxer::MakeUID(unsigned int* seed) {
|
mkvmuxer::uint64 mkvmuxer::MakeUID(unsigned int* seed) {
|
||||||
uint64 uid = 0;
|
uint64 uid = 0;
|
||||||
|
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
srand(*seed);
|
||||||
|
#endif
|
||||||
|
|
||||||
for (int i = 0; i < 7; ++i) { // avoid problems with 8-byte values
|
for (int i = 0; i < 7; ++i) { // avoid problems with 8-byte values
|
||||||
uid <<= 8;
|
uid <<= 8;
|
||||||
|
|
||||||
// TODO(fgalligan): Move random number generation to platform specific code.
|
// TODO(fgalligan): Move random number generation to platform specific code.
|
||||||
#ifdef _WIN32
|
#ifdef _MSC_VER
|
||||||
(void)seed;
|
(void)seed;
|
||||||
unsigned int random_value;
|
unsigned int random_value;
|
||||||
const errno_t e = rand_s(&random_value);
|
const errno_t e = rand_s(&random_value);
|
||||||
@ -687,6 +692,8 @@ mkvmuxer::uint64 mkvmuxer::MakeUID(unsigned int* seed) {
|
|||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
const int32 nn = temp_num;
|
const int32 nn = temp_num;
|
||||||
|
#elif defined __MINGW32__
|
||||||
|
const int32 nn = rand();
|
||||||
#else
|
#else
|
||||||
const int32 nn = rand_r(seed);
|
const int32 nn = rand_r(seed);
|
||||||
#endif
|
#endif
|
||||||
|
@ -5512,14 +5512,17 @@ long Track::Create(
|
|||||||
}
|
}
|
||||||
|
|
||||||
Track::Info::Info():
|
Track::Info::Info():
|
||||||
|
uid(0),
|
||||||
|
defaultDuration(0),
|
||||||
|
codecDelay(0),
|
||||||
|
seekPreRoll(0),
|
||||||
nameAsUTF8(NULL),
|
nameAsUTF8(NULL),
|
||||||
language(NULL),
|
language(NULL),
|
||||||
codecId(NULL),
|
codecId(NULL),
|
||||||
codecNameAsUTF8(NULL),
|
codecNameAsUTF8(NULL),
|
||||||
codecPrivate(NULL),
|
codecPrivate(NULL),
|
||||||
codecPrivateSize(0),
|
codecPrivateSize(0),
|
||||||
codecDelay(0),
|
lacing(false)
|
||||||
seekPreRoll(0)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ int MkvReader::Open(const char* fileName)
|
|||||||
if (m_file)
|
if (m_file)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _MSC_VER
|
||||||
const errno_t e = fopen_s(&m_file, fileName, "rb");
|
const errno_t e = fopen_s(&m_file, fileName, "rb");
|
||||||
|
|
||||||
if (e)
|
if (e)
|
||||||
@ -43,7 +43,7 @@ int MkvReader::Open(const char* fileName)
|
|||||||
return -1;
|
return -1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _MSC_VER
|
||||||
int status = _fseeki64(m_file, 0L, SEEK_END);
|
int status = _fseeki64(m_file, 0L, SEEK_END);
|
||||||
|
|
||||||
if (status)
|
if (status)
|
||||||
@ -56,7 +56,7 @@ int MkvReader::Open(const char* fileName)
|
|||||||
#endif
|
#endif
|
||||||
assert(m_length >= 0);
|
assert(m_length >= 0);
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _MSC_VER
|
||||||
status = _fseeki64(m_file, 0L, SEEK_SET);
|
status = _fseeki64(m_file, 0L, SEEK_SET);
|
||||||
|
|
||||||
if (status)
|
if (status)
|
||||||
@ -108,7 +108,7 @@ int MkvReader::Read(long long offset, long len, unsigned char* buffer)
|
|||||||
if (offset >= m_length)
|
if (offset >= m_length)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _MSC_VER
|
||||||
const int status = _fseeki64(m_file, offset, SEEK_SET);
|
const int status = _fseeki64(m_file, offset, SEEK_SET);
|
||||||
|
|
||||||
if (status)
|
if (status)
|
||||||
|
Loading…
Reference in New Issue
Block a user