From 0968b9055001ea2fdc87a36020fba9848e072279 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sun, 14 Aug 2022 16:22:56 +0000 Subject: [PATCH] Define new (un)signed integer types. Begin transition. Remove obsolete getCommandLineServer() --- src/channel.h | 22 +++++++++++----------- src/defines.h | 23 +++++++++++++++++------ src/playervideolive.cc | 10 +++++----- src/winmain.cc | 6 ------ 4 files changed, 33 insertions(+), 28 deletions(-) diff --git a/src/channel.h b/src/channel.h index 1825400..84280de 100644 --- a/src/channel.h +++ b/src/channel.h @@ -29,11 +29,11 @@ typedef struct _apid { - ULONG pid; + u4 pid; char desc[10]; - ULONG type; - ULONG data1; - ULONG data2; + u4 type; + u4 data1; + u4 data2; } apid; typedef std::vector APidList; @@ -44,19 +44,19 @@ class Channel void loadPids(); int index{-1}; - ULONG number{}; - ULONG type{}; + u4 number{}; + u4 type{}; UCHAR vstreamtype{2}; //Mpeg2 std::string name; - ULONG vpid{}; - ULONG numAPids{}; + u4 vpid{}; + u4 numAPids{}; APidList apids; - ULONG numDPids{}; + u4 numDPids{}; APidList dpids; - ULONG numSPids{}; + u4 numSPids{}; APidList spids; - ULONG tpid{}; + u4 tpid{}; }; #endif diff --git a/src/defines.h b/src/defines.h index fb003f7..f140035 100644 --- a/src/defines.h +++ b/src/defines.h @@ -1,5 +1,5 @@ /* - Copyright 2004-2020 Chris Tallon + Copyright 2004-2022 Chris Tallon This file is part of VOMP. @@ -26,6 +26,22 @@ typedef unsigned int UINT; typedef unsigned long ULONG; typedef unsigned long long ULLONG; +#include + +typedef int8_t i1; +typedef int16_t i2; +typedef int32_t i4; +typedef int64_t i8; +typedef uint8_t u1; +typedef uint16_t u2; +typedef uint32_t u4; +typedef uint64_t u8; + +#define toi4(arg) static_cast(arg) +#define tou4(arg) static_cast(arg) + + + #define OPTIONTYPE_TEXT 1 #define OPTIONTYPE_INT 2 @@ -36,13 +52,8 @@ typedef unsigned long long ULLONG; long long getTimeMS(); -#include - - int getClockRealTime(struct timespec *tp); -const std::string& getCommandLineServer(); - //#define WINDOWS_LEGACY #ifdef WIN32 diff --git a/src/playervideolive.cc b/src/playervideolive.cc index 47d8915..8c46d92 100644 --- a/src/playervideolive.cc +++ b/src/playervideolive.cc @@ -85,7 +85,7 @@ int PlayerVideoLive::init() //demux_audio_size*=2; } - int text_fak = video->getTeletextBufferFaktor(); + u4 text_fak = tou4(video->getTeletextBufferFaktor()); if (!demuxer->init(this, audio, video, teletext, demux_video_size, demux_audio_size, 65536 * text_fak, 25./*unimportant*/, subtitles)) { @@ -357,9 +357,9 @@ void PlayerVideoLive::chunkToDemuxer() StreamChunk s = streamChunks.front(); streamChunks.pop(); // logger->log("PlayerVideoLive", Log::DEBUG, "About to call demuxer with %p %lu", s.data, s.len); - /* int a =*/ demuxer->put(static_cast(s.data), s.len); + /* int a =*/ demuxer->put(static_cast(s.data), toi4(s.len)); // logger->log("PlayerVideoLive", Log::DEBUG, "put %i to demuxer", a); - free(s.data); + free(s.data); if (pendingAudioPlay && (demuxer->getHorizontalSize() || !video->independentAVStartUp())) //Horizontal Size is zero, if not parsed { video->sync(); @@ -731,7 +731,7 @@ void PlayerVideoLive::threadMethod() h264 = (chan->vstreamtype == 0x1b); demuxer->seth264(h264); video->seth264mode(h264); - demuxer->setVID(chan->vpid); + demuxer->setVID(toi4(chan->vpid)); video->seth264mode(h264); bool dolby = false; @@ -746,7 +746,7 @@ void PlayerVideoLive::threadMethod() while (j < chan->numDPids) { int newpref = control->getLangPref(false, chan->dpids[j].desc); - if (Audio::getInstance()->streamTypeSupported(chan->dpids[j].type) && (prefered < 0 || newpref < prefered)) + if (Audio::getInstance()->streamTypeSupported(toi4(chan->dpids[j].type)) && (prefered < 0 || newpref < prefered)) { selected = j; dolby=true; diff --git a/src/winmain.cc b/src/winmain.cc index cdbcb64..35a15ca 100644 --- a/src/winmain.cc +++ b/src/winmain.cc @@ -50,7 +50,6 @@ int debugEnabled = 0; Log* logger; InputWin* inputWin; Control* control; -std::string commandLineServer; // NCONFIG bool wnd_fullscreen=false; bool wnd_topmost=false; @@ -732,11 +731,6 @@ void shutdown(int code) // ------------------------------------------------------------------------------------------------------------------- -const std::string& getCommandLineServer() -{ - return commandLineServer; -} - #endif -- 2.39.5