48 Commits

Author SHA1 Message Date
jcdr428
5163c6d355 Set explicit casts
Change variable types when feasible to avoid casting
2022-01-09 00:38:15 +01:00
jcdr428
4f7c63d7fd Fix cast in write method 2022-01-08 19:52:34 +01:00
jcdr428
a2fda7978d Fix types class cast 2022-01-08 18:21:04 +01:00
jcdr428
917d1dbb37 Change throwFileError()
With flag FORMAT_MESSAGE_ALLOCATE_BUFFER, no need to define size of char buffer.
2022-01-05 20:09:11 +01:00
jcdr428
717bee2745 Fix previous commit for Linux 2022-01-04 21:54:00 +01:00
jcdr428
c2736c5a13 Change enum SeekMethod to enum cass type 2022-01-04 21:47:23 +01:00
jcdr428
fb513aaa0c [bug] Fix throwFileError()
Size in FormatMessage is DWORD type.

Plus: unnecessary large size of stack, reduced to below 16 KB.
2022-01-04 21:40:17 +01:00
jcdr428
a0b62c29cf Clang format check 2022-01-02 13:31:46 +01:00
jcdr428
812033a5fd Tidy-up metaDemuxer class
Reduce memory footprint of detectTrackReader
Correct types, make casting explicit
Add "srtToFloat" method
2022-01-02 13:26:53 +01:00
Daniel Kamil Kozar
88316ec3e9
Cleanup CMakeLists.txt a bit and add coverage builds (#493)
Add TSMUXER_COVERAGE which will result in building binaries with coverage information when set to true.
Move MSVC flag utf-8 from tsMuxerGUI to the general CMakeLists.txt as there is no reason not to enable it globally.
Replace NOT MSVC with checking if the build is for Linux : the effect is the same, but the intent is clearer.
Restructure the platform-specific conditions for building tsMuxerGUI.
Bind the XP build to windows-2019 hosts as windows-2022 includes Visual Studio 2022 which dropped XP support.
Don't install zlib via homebrew in macos in order to avoid conflicts with the system-provided one.
2021-11-14 02:06:30 +01:00
Daniel Kamil Kozar
c483756b42
Split directory.cpp into unix/win32 parts (#491)
directory.cpp was essentially two implementations in one, separated with ifdefs. It's cleaner to just have two separate files, seeing how CMakeLists.txt for libmediation needs to check the platform it's running on and add the appropriate file implementation anyway.

This commit splits this file into two and extracts common code parts to directory_priv.h.
2021-11-12 18:16:15 +01:00
Daniel Kamil Kozar
eabd0f2168
Use -D_FILE_OFFSET_BITS=64 instead of offset-width-specific functions (#488)
It looks like MacOS 11 removes the *64 functions, which have really been useless since 10.5 as off_t has been defined as 64-bit wide since that version.

_FILE_OFFSET_BITS is added and defined to 64 in case somebody wanted to compile tsMuxer as i386 and still have support for >2GB files.
2021-11-08 17:40:45 +01:00
jcdr428
83a6cae62a Upgrade to c++17
Add #define WIN32_LEAN_AND_MEAN to avoid conflict between new c++17 std::byte and windows.h byte type.
2021-09-22 21:33:14 +01:00
Daniel Kamil Kozar
4f21320a68
Fix warnings in file_unix.cpp (#383)
Long overdue fixes to the warnings in file_unix.cpp. Also, move the POSIX-exclusive fcntl.h include from file.h to file_unix.cpp and remove MSVC warning suppression related to exception specifications, which were also removed as they have been deprecated since C++11.
2020-12-21 00:22:24 +01:00
Daniel Kamil Kozar
61fe6ebbd7
Revert recent changes regarding directory separators (#308)
Some of these functions are called by the Bluray ISO image generation code which
always uses '/' as a directory separator.

Fixes #307.
2020-07-01 18:04:04 +02:00
Dan
d2c38c542f
Check for Invalid Characters in Output Filename (#274)
Fixes #268.
2020-06-26 23:33:50 +02:00
Dan Bryant
4aefb5cbdb clang-format 2020-03-04 15:26:30 +00:00
Dan Bryant
8db03e4821 ensure that when we extract the filename it won't stop on the first period encountered 2020-03-04 15:19:50 +00:00
Daniel Kamil Kozar
9670fd6b19
Remove all usages of std::wstring (#219)
This commit erases all usages of std::wstring from the face of the project and reduces wchar_t usages to the necessary minimum, mostly for interoperability with WinAPI functions. UTF-8 encoded std::strings are used in place of std::wstring objects, and code which must operate on actual characters instead of the bytes which might represent a character has been modified in order to work properly - mostly the subtitle renderer and reader classes.
2020-03-01 01:14:57 +01:00
Daniel Kamil Kozar
1bead15c8f
Don't use POSIX APIs in Windows builds (#212)
The POSIX compatibility layer provided by the Microsoft C Runtime Library
treats its string arguments as if they were passed to the A-family of WinAPI
functions, which means that they undergo conversion to the ACP before being
passed to the actual WinAPI call. Passing UTF-8 encoded strings could have
never really worked.
2020-02-27 22:20:36 +01:00
Daniel Kamil Kozar
31d39b60a7
Implement support for default audio and subtitle tracks when muxing to Blu-ray (#161)
Fixes #126.
2020-02-08 20:48:41 +01:00
Daniel Kamil Kozar
355151c7ea
Try using the active code page if conversion from UTF-8 fails (#181)
This makes the program compatible with meta files saved in ACP by older GUI
versions.
2020-02-06 22:38:54 +01:00
Daniel Kamil Kozar
92246c3367 Make the main binary a Unicode application on Windows
This commit uses "wide" (i.e. UTF-16) commandline arguments when launching the
program on Windows, and uses the "wide" Windows APIs when dealing with strings.
This makes it independent from the currently selected active code page on the
system, and hopefully fixes issues with "nonstandard" characters appearing in
file and directory paths.

Fixes #172.
2020-02-05 00:15:44 +01:00
Daniel Kamil Kozar
451ec61a50
Introduce a uniform formatting style (#131)
The repository now contains a clang-format file which should be used when committing new code. Additionally, a new workflow job is added which checks the conformance of source files to the specified formatting rules.

Fixes #47.
2020-01-14 21:56:44 +01:00
Dan Bryant
aaecc7c1d6 Merging pull request #67 2019-12-10 22:42:23 +00:00
Daniel Kamil Kozar
6bc34a6e54
Replace custom platform defines with standard ones 2019-12-08 16:31:56 +01:00
Daniel Kamil Kozar
d7994f1193
Fix MSYS2 build 2019-10-27 02:22:26 +02:00
Dan
8615976b6c
Merge pull request #22 from xavery/remove-stdafx
Remove stdafx.{cpp,h}
2019-10-26 22:52:15 +01:00
Daniel Kamil Kozar
721d5c12d9
Use std::thread in libmediation's TerminatableThread
TerminatableThread is now implemented by using std::thread. The terminate()
function provided by the base class was actually not used anywhere, and was
removed along with the base class itself.
As a bonus, the completely unused files common_win32.{cpp,h} are also removed.
2019-10-26 21:31:06 +02:00
Daniel Kamil Kozar
0fd3b37746
Remove stdafx.{cpp,h}
Precompiled headers aren't actually used by any of the compilers, so leaving
this header in the repo doesn't make much sense.
However, removing it revealed some places in the code which rely on windows.h
being included on WIN32, which was probably included via the tchar.h include.
These places have been fixed to explicitly include windows.h.
2019-10-26 21:15:03 +02:00
Dan Bryant
7550335ba3 Merge branch 'master' into enhancement-crossbuild 2019-10-25 17:08:50 +01:00
Daniel Kamil Kozar
9994ee5f44
Completely rework the CMake build system 2019-10-25 17:28:31 +02:00
Dan Bryant
4353e6a8f4 add initial MXE instructions, fix up some small issues when building on MXE 2019-10-25 13:06:29 +01:00
Dan Bryant
e909c7e028 work around exception specifier error on Windows, clean up readme 2019-10-25 11:56:08 +01:00
Dan Bryant
494a9ebf26 fix for Windows build in Docker, update CMake config to find zlib and libpng 2019-10-25 10:19:38 +01:00
Daniel Kamil Kozar
b098a6de41
Remove condvar, mutex and time from libmediation 2019-10-24 23:54:56 +02:00
Dan
a49263716f
Merge pull request #15 from justdan96/enhancement-crossbuild
Enhancement crossbuild
2019-10-24 20:13:07 +01:00
Dan Bryant
fc967d829f switch from make to cmake 2019-10-24 20:04:05 +01:00
Daniel Kamil Kozar
f5c9276e64
Translate comments from Russian to English
CVS log messages are left untouched in files which contain them, and those files
have been converted from Windows-1251 to UTF-8.
2019-10-22 00:45:41 +02:00
Dan
0345711711
Merge pull request #7 from qyot27/cmake
Add rudimentary CMake build system
2019-08-18 18:24:11 +01:00
Dan Bryant
aa0a56833c try to resolve some of the warnings in libmediation 2019-08-16 19:36:20 +01:00
Dan Bryant
5f623aae99 try to distinguish between 32-bit and 64-bit MinGW 2019-08-16 19:28:10 +01:00
Dan
1299e9689d
Merge branch 'master' into master 2019-08-16 18:50:18 +01:00
Stephen Hutchinson
309bdb210d Add rudimentary CMake build system
Currently can build tsmuxer CLI and libmediation in native 64-bit
on Linux.  Windows, Mac, and 32-bit untested (32-bit is mostly
a function of the user's CXX_FLAGS settings anyway).

As a consequence of trying to get it to build the correct files,
the textSubtitleRender{FT|Win32}.* files had to be moved to an
osdep/ subdirectory.  Some #include cases were also fixed to
point to the correct headers and directories in the source
tree or elsewhere.

Install rules need to be fleshed out for static/shared libs and
headers for libmediation, uninstall rules need to be added.

tsMuxerGUI needs to be hooked in as well.
2019-08-11 15:00:42 -04:00
Dan Bryant
c6d101b7c1 update for building with Msys2 on Windows 2019-08-11 17:10:03 +01:00
Markus Feist
b52eeca7a8 update for building on linux arm 2019-08-09 21:26:25 +02:00
Dan Bryant
00a5db41fe update for building on Windows 2019-07-28 22:49:07 +01:00
Dan Bryant
1b6abe9a0d add libmediation, update make_pair functions to be usable with C++11, update Makefile for modern systems and bring readme up-to-date 2019-07-23 23:05:20 +01:00