1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-10 23:24:06 +02:00

#129 sync audio/video chunks for STR video decoder; #15 fix windows release build, no logging

This commit is contained in:
XProger
2019-01-13 06:03:08 +03:00
parent 9946d28875
commit 347bb78e22
3 changed files with 14 additions and 5 deletions

View File

@@ -735,7 +735,7 @@ int main(int argc, char** argv) {
int main(int argc, char** argv) {
#else
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
int argc = lpCmdLine ? 2 : 1;
int argc = (lpCmdLine && strlen(lpCmdLine)) ? 2 : 1;
char *argv[] = { "", lpCmdLine };
#endif
cacheDir[0] = saveDir[0] = contentDir[0] = 0;

View File

@@ -26,11 +26,14 @@
#define ASSERT(expr)
#define ASSERTV(expr) (expr) ? 1 : 0
#ifdef _OS_LINUX
#define LOG(...) printf(__VA_ARGS__); fflush(stdout)
#ifdef PROFILE
#ifdef _OS_LINUX
#define LOG(...) printf(__VA_ARGS__); fflush(stdout)
#else
#define LOG(...) printf(__VA_ARGS__)
#endif
#else
#define LOG(...) printf(__VA_ARGS__)
// #define LOG(...) 0
#define LOG(...) 0
#endif
#endif

View File

@@ -863,6 +863,9 @@ struct Video {
bool nextChunk() {
OS_LOCK(Sound::lock);
if (videoChunks[videoChunksCount % MAX_CHUNKS].size > 0)
return false;
if (stream->pos >= stream->size)
return false;
@@ -1059,6 +1062,8 @@ struct Video {
}
}
chunk->size = 0;
return true;
}
@@ -1072,6 +1077,7 @@ struct Video {
curAudioChunk++;
while (curAudioChunk >= audioChunksCount) {
if (!nextChunk()) {
curAudioChunk--;
memset(frames, 0, count * sizeof(Sound::Frame));
return count;
}