From 01d43796adcd7ce74925ed3b56275112fb6a3365 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Sat, 26 Jan 2019 00:27:57 +0100 Subject: [PATCH] 32-bit fixes --- lib/sdp.cpp | 2 +- lib/ts_stream.cpp | 8 ++++---- src/analysers/analyser.cpp | 2 +- src/analysers/analyser_ts.cpp | 4 ++-- src/controller/controller_statistics.cpp | 12 ++++++------ src/input/input.cpp | 4 ++-- src/input/input_balancer.cpp | 4 ++-- src/input/input_buffer.cpp | 24 ++++++++++++------------ src/input/input_dtsccrypt.cpp | 2 +- src/input/input_folder.cpp | 4 ++-- src/input/input_hls.cpp | 2 +- src/input/input_ismv.cpp | 16 ++++++++-------- src/input/input_mp4.cpp | 10 +++++----- src/input/input_rtsp.cpp | 8 ++++---- src/input/input_srt.cpp | 4 ++-- src/input/input_ts.cpp | 10 +++++----- src/output/output.cpp | 16 ++++++++-------- src/output/output.h | 6 +++--- src/output/output_dash_mp4.cpp | 2 +- src/output/output_dtsc.cpp | 4 ++-- src/output/output_ebml.cpp | 2 +- src/output/output_h264.cpp | 2 +- src/output/output_hls.cpp | 8 ++++---- src/output/output_progressive_flv.cpp | 2 +- src/output/output_rtmp.cpp | 14 +++++++------- src/output/output_rtsp.cpp | 4 ++-- src/output/output_ts.cpp | 2 +- src/output/output_wav.cpp | 4 ++-- 28 files changed, 91 insertions(+), 91 deletions(-) diff --git a/lib/sdp.cpp b/lib/sdp.cpp index 604b184b..5338610b 100644 --- a/lib/sdp.cpp +++ b/lib/sdp.cpp @@ -654,7 +654,7 @@ namespace SDP{ if (tracks.size()){ for (std::map::iterator it = tracks.begin(); it != tracks.end(); ++it){ if (!it->second.control.size()){ - it->second.control = "/track" + JSON::Value((long long)it->first).asString(); + it->second.control = "/track" + JSON::Value(it->first).asString(); INFO_MSG("Control track: %s", it->second.control.c_str()); } diff --git a/lib/ts_stream.cpp b/lib/ts_stream.cpp index b7678f49..2b53dc23 100644 --- a/lib/ts_stream.cpp +++ b/lib/ts_stream.cpp @@ -246,7 +246,7 @@ namespace TS{ bool Stream::hasPacket(size_t tid) const { tthread::lock_guard guard(tMutex); - std::map >::const_iterator pesIt = pesStreams.find(tid); + std::map >::const_iterator pesIt = pesStreams.find(tid); if (pesIt == pesStreams.end()){ return false; } @@ -275,7 +275,7 @@ namespace TS{ } } - for (std::map::const_iterator i = seenUnitStart.begin(); + for (std::map::const_iterator i = seenUnitStart.begin(); i != seenUnitStart.end(); i++){ if (pidToCodec.count(i->first) && i->second > 1){ return true; @@ -327,7 +327,7 @@ namespace TS{ // We now know we're deleting 1 UnitStart, so we can pop the pesPositions and lower the seenUnitStart counter. --(seenUnitStart[tid]); - std::deque &inPositions = pesPositions[tid]; + std::deque &inPositions = pesPositions[tid]; uint64_t bPos = inPositions.front(); inPositions.pop_front(); @@ -971,7 +971,7 @@ namespace TS{ } } - std::set Stream::getActiveTracks(){ + std::set Stream::getActiveTracks(){ tthread::lock_guard guard(tMutex); std::set result; // Track 0 is always active diff --git a/src/analysers/analyser.cpp b/src/analysers/analyser.cpp index 0cf6c198..b9e332b5 100644 --- a/src/analysers/analyser.cpp +++ b/src/analysers/analyser.cpp @@ -109,7 +109,7 @@ void Analyser::init(Util::Config &conf){ opt["long"] = "timeout"; opt["short"] = "T"; opt["arg"] = "num"; - opt["default"] = 0ll; + opt["default"] = 0; opt["help"] = "Time out after X seconds of processing/retrieving"; conf.addOption("timeout", opt); opt.null(); diff --git a/src/analysers/analyser_ts.cpp b/src/analysers/analyser_ts.cpp index c57d5e35..f01093ac 100644 --- a/src/analysers/analyser_ts.cpp +++ b/src/analysers/analyser_ts.cpp @@ -23,7 +23,7 @@ void AnalyserTS::init(Util::Config &conf){ opt["long"] = "detail"; opt["short"] = "D"; opt["arg"] = "num"; - opt["default"] = 3ll; + opt["default"] = 3; opt["help"] = "Detail level of analysis bitmask (default=3). 1 = PES, 2 = TS non-stream pkts, 4 " "= TS stream pkts, 32 = raw PES packet bytes, 64 = raw TS packet bytes"; conf.addOption("detail", opt); @@ -31,7 +31,7 @@ void AnalyserTS::init(Util::Config &conf){ opt["long"] = "pid"; opt["short"] = "P"; opt["arg"] = "num"; - opt["default"] = 0ll; + opt["default"] = 0; opt["help"] = "Only use the given PID, ignore others"; conf.addOption("pid", opt); opt.null(); diff --git a/src/controller/controller_statistics.cpp b/src/controller/controller_statistics.cpp index 00611942..cb00c8ce 100644 --- a/src/controller/controller_statistics.cpp +++ b/src/controller/controller_statistics.cpp @@ -479,7 +479,7 @@ uint32_t Controller::statSession::invalidate(){ uint32_t ret = 0; sync = 1; if (curConns.size() && statPointer){ - for (std::map::iterator jt = curConns.begin(); jt != curConns.end(); ++jt){ + for (std::map::iterator jt = curConns.begin(); jt != curConns.end(); ++jt){ char * data = statPointer->getIndex(jt->first); if (data){ IPC::statExchange tmpEx(data); @@ -497,7 +497,7 @@ uint32_t Controller::statSession::kill(){ uint32_t ret = 0; sync = 100; if (curConns.size() && statPointer){ - for (std::map::iterator jt = curConns.begin(); jt != curConns.end(); ++jt){ + for (std::map::iterator jt = curConns.begin(); jt != curConns.end(); ++jt){ char * data = statPointer->getIndex(jt->first); if (data){ IPC::statExchange tmpEx(data); @@ -1725,9 +1725,9 @@ void Controller::handlePrometheus(HTTP::Parser & H, Socket::Connection & conn, i tthread::lock_guard guard(statsMutex); //collect the data first std::map outputs; - unsigned long totViewers = 0, totInputs = 0, totOutputs = 0; - unsigned int tOut = Util::epoch() - STATS_DELAY; - unsigned int tIn = Util::epoch() - STATS_INPUT_DELAY; + uint64_t totViewers = 0, totInputs = 0, totOutputs = 0; + uint64_t tOut = Util::epoch() - STATS_DELAY; + uint64_t tIn = Util::epoch() - STATS_INPUT_DELAY; //check all sessions if (sessions.size()){ for (std::map::iterator it = sessions.begin(); it != sessions.end(); it++){ @@ -1757,7 +1757,7 @@ void Controller::handlePrometheus(HTTP::Parser & H, Socket::Connection & conn, i resp["curr"].append(totViewers); resp["curr"].append(totInputs); resp["curr"].append(totOutputs); - resp["curr"].append(sessions.size()); + resp["curr"].append((uint64_t)sessions.size()); resp["tot"].append(servViewers); resp["tot"].append(servInputs); resp["tot"].append(servOutputs); diff --git a/src/input/input.cpp b/src/input/input.cpp index 1f860728..22e4388b 100644 --- a/src/input/input.cpp +++ b/src/input/input.cpp @@ -169,10 +169,10 @@ namespace Mist { static JSON::Value thisPack; thisPack.null(); thisPack["trackid"] = srtTrack; - thisPack["bpos"] = (long long)srtSource.tellg(); + thisPack["bpos"] = (uint64_t)srtSource.tellg(); thisPack["data"] = data; thisPack["index"] = index; - thisPack["time"] = (long long)timestamp; + thisPack["time"] = timestamp; thisPack["duration"] = duration; std::string tmpStr = thisPack.toNetPacked(); diff --git a/src/input/input_balancer.cpp b/src/input/input_balancer.cpp index 726fa1bf..184d60c5 100644 --- a/src/input/input_balancer.cpp +++ b/src/input/input_balancer.cpp @@ -9,8 +9,8 @@ namespace Mist { capa["name"] = "Balancer"; capa["desc"] = "The load balancer input restarts itself as the input a load balancer tells it it should be. The syntax is in the form 'balance:http://HOST:PORT[?fallback=FALLBACK]', where HOST and PORT are the host and port of the load balancer and the FALLBACK is the full source URL that should be used if the load balancer cannot be reached."; capa["source_match"] = "balance:*"; - capa["priority"] = 9ll; - capa["morphic"] = 1ll; + capa["priority"] = 9; + capa["morphic"] = 1; } int inputBalancer::boot(int argc, char * argv[]){ diff --git a/src/input/input_buffer.cpp b/src/input/input_buffer.cpp index 6d2b1806..0cc263d9 100644 --- a/src/input/input_buffer.cpp +++ b/src/input/input_buffer.cpp @@ -204,7 +204,7 @@ namespace Mist { std::stringstream issues; for (std::map::iterator it = myMeta.tracks.begin(); it != myMeta.tracks.end(); it++){ JSON::Value & track = details[it->second.getWritableIdentifier()]; - track["kbits"] = (long long)((double)it->second.bps * 8 / 1024); + track["kbits"] = (uint64_t)((double)it->second.bps * 8 / 1024); track["codec"] = it->second.codec; uint32_t shrtest_key = 0xFFFFFFFFul; uint32_t longest_key = 0; @@ -221,19 +221,19 @@ namespace Mist { if ((k->getLength()/k->getParts()) > longest_prt){longest_prt = (k->getLength()/k->getParts());} if ((k->getLength()/k->getParts()) < shrtest_prt){shrtest_prt = (k->getLength()/k->getParts());} } - track["keys"]["ms_min"] = (long long)shrtest_key; - track["keys"]["ms_max"] = (long long)longest_key; - track["keys"]["frame_ms_min"] = (long long)shrtest_prt; - track["keys"]["frame_ms_max"] = (long long)longest_prt; - track["keys"]["frames_min"] = (long long)shrtest_cnt; - track["keys"]["frames_max"] = (long long)longest_cnt; + track["keys"]["ms_min"] = shrtest_key; + track["keys"]["ms_max"] = longest_key; + track["keys"]["frame_ms_min"] = shrtest_prt; + track["keys"]["frame_ms_max"] = longest_prt; + track["keys"]["frames_min"] = shrtest_cnt; + track["keys"]["frames_max"] = longest_cnt; if (longest_prt > 500){issues << "unstable connection (" << longest_prt << "ms " << it->second.codec << " frame)! ";} if (shrtest_cnt < 6){issues << "unstable connection (" << shrtest_cnt << " " << it->second.codec << " frames in key)! ";} if (it->second.codec == "AAC"){hasAAC = true;} if (it->second.codec == "H264"){hasH264 = true;} if (it->second.type=="video"){ - track["width"] = (long long)it->second.width; - track["height"] = (long long)it->second.height; + track["width"] = it->second.width; + track["height"] = it->second.height; track["fpks"] = it->second.fpks; } } @@ -496,7 +496,7 @@ namespace Mist { } /*LTS-START*/ if (Triggers::shouldTrigger("STREAM_TRACK_REMOVE")) { - std::string payload = config->getString("streamname") + "\n" + JSON::Value((long long)it->first).asString() + "\n"; + std::string payload = config->getString("streamname") + "\n" + JSON::Value((uint64_t)it->first).asString() + "\n"; Triggers::doTrigger("STREAM_TRACK_REMOVE", payload, config->getString("streamname")); } /*LTS-END*/ @@ -786,13 +786,13 @@ namespace Mist { collidesWith = -1; } /*LTS-START*/ - unsigned long finalMap = collidesWith; + uint64_t finalMap = collidesWith; if (finalMap == -1) { //No collision has been detected, assign a new final number finalMap = (myMeta.tracks.size() ? myMeta.tracks.rbegin()->first : 0) + 1; DEBUG_MSG(DLVL_DEVEL, "No colision detected for temporary track %lu from user %u, assigning final track number %lu", value, id, finalMap); if (Triggers::shouldTrigger("STREAM_TRACK_ADD")) { - std::string payload = config->getString("streamname") + "\n" + JSON::Value((long long)finalMap).asString() + "\n"; + std::string payload = config->getString("streamname") + "\n" + JSON::Value(finalMap).asString() + "\n"; Triggers::doTrigger("STREAM_TRACK_ADD", payload, config->getString("streamname")); } } diff --git a/src/input/input_dtsccrypt.cpp b/src/input/input_dtsccrypt.cpp index f86e30aa..1c76ccce 100644 --- a/src/input/input_dtsccrypt.cpp +++ b/src/input/input_dtsccrypt.cpp @@ -17,7 +17,7 @@ namespace Mist { inputDTSC::inputDTSC(Util::Config * cfg) : Input(cfg) { capa["name"] = "DTSC"; capa["desc"] = "Enables DTSC Input"; - capa["priority"] = 9ll; + capa["priority"] = 9; capa["source_match"] = "/*.dtsc"; capa["codecs"][0u][0u].append("H264"); capa["codecs"][0u][0u].append("H263"); diff --git a/src/input/input_folder.cpp b/src/input/input_folder.cpp index 214c69b4..976fd6ee 100644 --- a/src/input/input_folder.cpp +++ b/src/input/input_folder.cpp @@ -12,8 +12,8 @@ namespace Mist { capa["desc"] = "The folder input will make available all supported files in the given folder as streams under this stream name, in the format STREAMNAME+FILENAME. For example, if your stream is called 'files' and you have a file called 'movie.flv', you could access this file streamed as 'files+movie.flv'. This input does not support subdirectories. To support more complex libraries, look into the documentation for the STREAM_SOURCE trigger."; capa["source_match"] = "/*/"; capa["source_file"] = "$source/$wildcard"; - capa["priority"] = 9ll; - capa["morphic"] = 1ll; + capa["priority"] = 9; + capa["morphic"] = 1; } int inputFolder::boot(int argc, char * argv[]){ diff --git a/src/input/input_hls.cpp b/src/input/input_hls.cpp index aaf64b8f..56e07d58 100644 --- a/src/input/input_hls.cpp +++ b/src/input/input_hls.cpp @@ -264,7 +264,7 @@ namespace Mist{ // All URLs can be set to always-on mode. capa["always_match"] = capa["source_match"]; - capa["priority"] = 9ll; + capa["priority"] = 9; capa["codecs"][0u][0u].append("H264"); capa["codecs"][0u][1u].append("AAC"); capa["codecs"][0u][1u].append("AC3"); diff --git a/src/input/input_ismv.cpp b/src/input/input_ismv.cpp index 8cf6636d..9c3b5f35 100644 --- a/src/input/input_ismv.cpp +++ b/src/input/input_ismv.cpp @@ -15,7 +15,7 @@ namespace Mist { capa["name"] = "ISMV"; capa["desc"] = "This input allows you to stream ISMV Video on Demand files."; capa["source_match"] = "/*.ismv"; - capa["priority"] = 9ll; + capa["priority"] = 9; capa["codecs"][0u][0u].append("H264"); capa["codecs"][0u][1u].append("AAC"); @@ -97,7 +97,7 @@ namespace Mist { if (i) { lastBytePos ++; } else { - lastPack["keyframe"] = 1LL; + lastPack["keyframe"] = 1; lastBytePos = curBytePos; } lastPack["bpos"] = lastBytePos; @@ -105,7 +105,7 @@ namespace Mist { lastPack["offset"] = (int)offsetConv; } else { if (i == 0) { - lastPack["keyframe"] = 1LL; + lastPack["keyframe"] = 1; lastPack["bpos"] = curBytePos; } } @@ -128,7 +128,7 @@ namespace Mist { return; } int tId = buffered.begin()->trackId; - thisPack["time"] = (long long int)(buffered.begin()->time / 10000); + thisPack["time"] = (uint64_t)(buffered.begin()->time / 10000); thisPack["trackid"] = tId; fseek(inFile, buffered.begin()->position, SEEK_SET); char * tmpData = (char*)malloc(buffered.begin()->size * sizeof(char)); @@ -140,15 +140,15 @@ namespace Mist { } if (myMeta.tracks[tId].type == "video") { if (buffered.begin()->isKeyFrame) { - thisPack["keyframe"] = 1LL; + thisPack["keyframe"] = 1; } - thisPack["offset"] = buffered.begin()->offset / 10000; + thisPack["offset"] = (uint64_t)(buffered.begin()->offset / 10000); } else { if (buffered.begin()->isKeyFrame) { - thisPack["keyframe"] = 1LL; + thisPack["keyframe"] = 1; } } - thisPack["bpos"] = buffered.begin()->position; + thisPack["bpos"] = (uint64_t)buffered.begin()->position; buffered.erase(buffered.begin()); if (buffered.size() < 2 * selectedTracks.size()){ for (std::set::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){ diff --git a/src/input/input_mp4.cpp b/src/input/input_mp4.cpp index 5fff3c09..1a99baaa 100644 --- a/src/input/input_mp4.cpp +++ b/src/input/input_mp4.cpp @@ -161,7 +161,7 @@ namespace Mist{ capa["desc"] = "This input allows streaming of MP4 files as Video on Demand."; capa["source_match"] = "/*.mp4"; capa["source_file"] = "$source"; - capa["priority"] = 9ll; + capa["priority"] = 9; capa["codecs"][0u][0u].append("HEVC"); capa["codecs"][0u][0u].append("H264"); capa["codecs"][0u][0u].append("H263"); @@ -502,12 +502,12 @@ namespace Mist{ static JSON::Value thisPack; thisPack.null(); - thisPack["trackid"] = (long long)curPart.trackID; - thisPack["bpos"] = (long long)curPart.bpos; //(long long)fileSource.tellg(); + thisPack["trackid"] = (uint64_t)curPart.trackID; + thisPack["bpos"] = curPart.bpos; //(long long)fileSource.tellg(); thisPack["data"] = std::string(data+2,txtLen); - thisPack["time"] = (long long)curPart.time; + thisPack["time"] = curPart.time; if (curPart.duration){ - thisPack["duration"] = (long long)curPart.duration; + thisPack["duration"] = curPart.duration; } thisPack["keyframe"] = true; // Write the json value to lastpack diff --git a/src/input/input_rtsp.cpp b/src/input/input_rtsp.cpp index 11ec8bcb..3cf2eb5a 100755 --- a/src/input/input_rtsp.cpp +++ b/src/input/input_rtsp.cpp @@ -33,7 +33,7 @@ namespace Mist{ capa["source_match"].append("rtsp://*"); // These can/may be set to always-on mode capa["always_match"].append("rtsp://*"); - capa["priority"] = 9ll; + capa["priority"] = 9; capa["codecs"][0u][0u].append("H264"); capa["codecs"][0u][0u].append("HEVC"); capa["codecs"][0u][0u].append("MPEG2"); @@ -51,7 +51,7 @@ namespace Mist{ option["long"] = "buffer"; option["short"] = "b"; option["help"] = "DVR buffer time in ms"; - option["value"].append(50000LL); + option["value"].append(50000); config->addOption("bufferTime", option); capa["optional"]["DVR"]["name"] = "Buffer time (ms)"; capa["optional"]["DVR"]["help"] = "The target available buffer time for this live stream, in " @@ -60,7 +60,7 @@ namespace Mist{ "as well as the minimum duration needed for stable playback."; capa["optional"]["DVR"]["option"] = "--buffer"; capa["optional"]["DVR"]["type"] = "uint"; - capa["optional"]["DVR"]["default"] = 50000LL; + capa["optional"]["DVR"]["default"] = 50000; option.null(); option["arg"] = "string"; option["long"] = "transport"; @@ -93,7 +93,7 @@ namespace Mist{ sndH.auth(username, password, authRequest); } sndH.SetHeader("User-Agent", "MistServer " PACKAGE_VERSION); - sndH.SetHeader("CSeq", JSON::Value((long long)cSeq).asString()); + sndH.SetHeader("CSeq", JSON::Value(cSeq).asString()); if (session.size()){sndH.SetHeader("Session", session);} if (extraHeaders && extraHeaders->size()){ for (std::map::const_iterator it = extraHeaders->begin(); diff --git a/src/input/input_srt.cpp b/src/input/input_srt.cpp index bfefbef0..9fa1dc8c 100644 --- a/src/input/input_srt.cpp +++ b/src/input/input_srt.cpp @@ -8,7 +8,7 @@ namespace Mist{ capa["decs"] = "This input allows streaming of SRT and WebVTT subtitle files as Video on Demand."; capa["source_match"].append("/*.srt"); capa["source_match"].append("/*.vtt"); - capa["priority"] = 9ll; + capa["priority"] = 9; capa["codecs"][0u][0u].append("subtitle"); } @@ -92,7 +92,7 @@ namespace Mist{ static JSON::Value thisPack; thisPack.null(); thisPack["trackid"] = 1; - thisPack["bpos"] = (long long)fileSource.tellg(); + thisPack["bpos"] = (uint64_t)fileSource.tellg(); thisPack["data"] = data; thisPack["index"] = index; thisPack["time"] = timestamp; diff --git a/src/input/input_ts.cpp b/src/input/input_ts.cpp index 2673b85a..e496d3fc 100755 --- a/src/input/input_ts.cpp +++ b/src/input/input_ts.cpp @@ -128,7 +128,7 @@ namespace Mist { capa["always_match"].append("http-ts://*"); capa["incoming_push_url"] = "udp://$host:$port"; capa["incoming_push_url_match"] = "tsudp://*"; - capa["priority"] = 9ll; + capa["priority"] = 9; capa["codecs"][0u][0u].append("H264"); capa["codecs"][0u][0u].append("HEVC"); capa["codecs"][0u][0u].append("MPEG2"); @@ -143,13 +143,13 @@ namespace Mist { option["long"] = "buffer"; option["short"] = "b"; option["help"] = "DVR buffer time in ms"; - option["value"].append(50000LL); + option["value"].append(50000); config->addOption("bufferTime", option); capa["optional"]["DVR"]["name"] = "Buffer time (ms)"; capa["optional"]["DVR"]["help"] = "The target available buffer time for this live stream, in milliseconds. This is the time available to seek around in, and will automatically be extended to fit whole keyframes as well as the minimum duration needed for stable playback."; capa["optional"]["DVR"]["option"] = "--buffer"; capa["optional"]["DVR"]["type"] = "uint"; - capa["optional"]["DVR"]["default"] = 50000LL; + capa["optional"]["DVR"]["default"] = 50000; } inputTS::~inputTS() { @@ -522,7 +522,7 @@ namespace Mist { } nProxy.userClient.keepAlive(); - std::set activeTracks = liveStream.getActiveTracks(); + std::set activeTracks = liveStream.getActiveTracks(); { tthread::lock_guard guard(threadClaimMutex); if (hasStarted && !threadTimer.size()){ @@ -534,7 +534,7 @@ namespace Mist { hasStarted = false; } } - for (std::set::iterator it = activeTracks.begin(); it != activeTracks.end(); it++) { + for (std::set::iterator it = activeTracks.begin(); it != activeTracks.end(); it++) { if (!liveStream.isDataTrack(*it)){continue;} if (threadTimer.count(*it) && ((Util::bootSecs() - threadTimer[*it]) > (2 * THREAD_TIMEOUT))) { WARN_MSG("Thread for track %d timed out %d seconds ago without a clean shutdown.", *it, Util::bootSecs() - threadTimer[*it]); diff --git a/src/output/output.cpp b/src/output/output.cpp index 650d0be1..c5e7fab8 100644 --- a/src/output/output.cpp +++ b/src/output/output.cpp @@ -289,7 +289,7 @@ namespace Mist{ HIGH_MSG("USER_NEW sync achieved: %u", (unsigned int)tmpEx.getSync()); //1 = check requested (connection is new) if (tmpEx.getSync() == 1){ - std::string payload = streamName+"\n" + getConnectedHost() +"\n" + JSON::Value((long long)crc).asString() + "\n"+capa["name"].asStringRef()+"\n"+reqUrl+"\n"+tmpEx.getSessId(); + std::string payload = streamName+"\n" + getConnectedHost() +"\n" + JSON::Value(crc).asString() + "\n"+capa["name"].asStringRef()+"\n"+reqUrl+"\n"+tmpEx.getSessId(); if (!Triggers::doTrigger("USER_NEW", payload, streamName)){ onFail("Not allowed to play (USER_NEW)"); tmpEx.setSync(100);//100 = denied @@ -428,7 +428,7 @@ namespace Mist{ while (std::getline(ss, item, ',')){selectTrack(trackType, item);} return; } - long long trackNo = JSON::Value(trackVal).asInt(); + uint64_t trackNo = JSON::Value(trackVal).asInt(); if (trackVal == JSON::Value(trackNo).asString()){ //It's an integer number if (!myMeta.tracks.count(trackNo)){ @@ -1010,7 +1010,7 @@ namespace Mist{ WARN_MSG("Recording start time is earlier than stream begin - starting earliest possible"); targetParams["recstart"] = "-1"; }else{ - targetParams["recstart"] = JSON::Value((long long)((startUnix - unixStreamBegin)*1000)).asString(); + targetParams["recstart"] = JSON::Value((int64_t)((startUnix - unixStreamBegin)*1000)).asString(); } } if (targetParams.count("recstopunix")){ @@ -1019,7 +1019,7 @@ namespace Mist{ onFail("Recording stop time is earlier than stream begin - aborting", true); return; }else{ - targetParams["recstop"] = JSON::Value((long long)((stopUnix - unixStreamBegin)*1000)).asString(); + targetParams["recstop"] = JSON::Value((int64_t)((stopUnix - unixStreamBegin)*1000)).asString(); } } } @@ -1069,7 +1069,7 @@ namespace Mist{ WARN_MSG("Start time is earlier than stream begin - starting earliest possible"); targetParams["start"] = "-1"; }else{ - targetParams["start"] = JSON::Value((long long)((startUnix - unixStreamBegin)*1000)).asString(); + targetParams["start"] = JSON::Value((int64_t)((startUnix - unixStreamBegin)*1000)).asString(); } } if (targetParams.count("stopunix")){ @@ -1079,7 +1079,7 @@ namespace Mist{ onFail("Stop time is earlier than stream begin - aborting", true); return; }else{ - targetParams["stop"] = JSON::Value((long long)((stopUnix - unixStreamBegin)*1000)).asString(); + targetParams["stop"] = JSON::Value((int64_t)((stopUnix - unixStreamBegin)*1000)).asString(); } } } @@ -1531,9 +1531,9 @@ namespace Mist{ loadPageForKey(nxt.tid, ++nxtKeyNum[nxt.tid]); nxt.offset = 0; if (nProxy.curPage.count(nxt.tid) && nProxy.curPage[nxt.tid].mapped){ - unsigned long long nextTime = getDTSCTime(nProxy.curPage[nxt.tid].mapped, nxt.offset); + uint64_t nextTime = getDTSCTime(nProxy.curPage[nxt.tid].mapped, nxt.offset); if (nextTime && nextTime < nxt.time){ - dropTrack(nxt.tid, "EOP: time going backwards ("+JSON::Value((long long)nextTime).asString()+" < "+JSON::Value((long long)nxt.time).asString()+")"); + dropTrack(nxt.tid, "EOP: time going backwards ("+JSON::Value(nextTime).asString()+" < "+JSON::Value(nxt.time).asString()+")"); }else{ if (nextTime){ nxt.time = nextTime; diff --git a/src/output/output.h b/src/output/output.h index b6f12d90..2db11467 100644 --- a/src/output/output.h +++ b/src/output/output.h @@ -22,9 +22,9 @@ namespace Mist { } return (time == rhs.time && tid < rhs.tid); } - unsigned int tid; - long long unsigned int time; - unsigned int offset; + uint64_t tid; + uint64_t time; + uint32_t offset; }; /// The output class is intended to be inherited by MistOut process classes. diff --git a/src/output/output_dash_mp4.cpp b/src/output/output_dash_mp4.cpp index 79331c3e..1758c3b4 100644 --- a/src/output/output_dash_mp4.cpp +++ b/src/output/output_dash_mp4.cpp @@ -502,7 +502,7 @@ namespace Mist{ //MP3 does not work in browsers capa["exceptions"]["codec:MP3"] = JSON::fromString("[[\"blacklist\",[\"Mozilla/\"]]]"); - capa["methods"][0u]["priority"] = 8ll; + capa["methods"][0u]["priority"] = 8; cfg->addOption("nonchunked", JSON::fromString("{\"short\":\"C\",\"long\":\"nonchunked\",\"help\":\"Do not send chunked, but buffer whole segments.\"}")); capa["optional"]["nonchunked"]["name"] = "Send whole segments"; diff --git a/src/output/output_dtsc.cpp b/src/output/output_dtsc.cpp index cf9d7484..98fb6e13 100644 --- a/src/output/output_dtsc.cpp +++ b/src/output/output_dtsc.cpp @@ -14,8 +14,8 @@ namespace Mist { JSON::Value prep; prep["cmd"] = "hi"; prep["version"] = "MistServer " PACKAGE_VERSION; - prep["pack_method"] = 2ll; - salt = Secure::md5("mehstuff"+JSON::Value((long long)time(0)).asString()); + prep["pack_method"] = 2; + salt = Secure::md5("mehstuff"+JSON::Value((uint64_t)time(0)).asString()); prep["salt"] = salt; /// \todo Make this securererer. sendCmd(prep); diff --git a/src/output/output_ebml.cpp b/src/output/output_ebml.cpp index c391ad69..0e663d2d 100644 --- a/src/output/output_ebml.cpp +++ b/src/output/output_ebml.cpp @@ -98,7 +98,7 @@ namespace Mist{ JSON::Value opt; opt["arg"] = "string"; opt["default"] = ""; - opt["arg_num"] = 1ll; + opt["arg_num"] = 1; opt["help"] = "Target filename to store EBML file as, or - for stdout."; cfg->addOption("target", opt); } diff --git a/src/output/output_h264.cpp b/src/output/output_h264.cpp index 7d41dbac..485a9031 100644 --- a/src/output/output_h264.cpp +++ b/src/output/output_h264.cpp @@ -41,7 +41,7 @@ namespace Mist{ JSON::Value opt; opt["arg"] = "string"; opt["default"] = ""; - opt["arg_num"] = 1ll; + opt["arg_num"] = 1; opt["help"] = "Target filename to store H264 file as, or - for stdout."; cfg->addOption("target", opt); } diff --git a/src/output/output_hls.cpp b/src/output/output_hls.cpp index ee53c251..c51407b7 100644 --- a/src/output/output_hls.cpp +++ b/src/output/output_hls.cpp @@ -314,9 +314,9 @@ namespace Mist { //Skip the current last fragment if we are live continue; } - long long int starttime = myMeta.tracks[*it].getKey(it3->getNumber()).getTime(); + uint64_t starttime = myMeta.tracks[*it].getKey(it3->getNumber()).getTime(); std::stringstream line; - long long duration = it3->getDuration(); + uint64_t duration = it3->getDuration(); if (duration <= 0) { duration = myMeta.tracks[*it].lastms - starttime; } @@ -326,7 +326,7 @@ namespace Mist { //segment["url"] = segmenturl.str(); segment["time"] = starttime; segment["duration"] = duration; - segment["number"] = (unsigned int)it3->getNumber(); + segment["number"] = (uint64_t)it3->getNumber(); quality["segments"].append(segment); } result["qualities"].append(quality); @@ -371,7 +371,7 @@ namespace Mist { cfg->addOption("listlimit", JSON::fromString("{\"arg\":\"integer\",\"default\":0,\"short\":\"y\",\"long\":\"list-limit\",\"help\":\"Maximum number of parts in live playlists (0 = infinite).\"}")); capa["optional"]["listlimit"]["name"] = "Live playlist limit"; capa["optional"]["listlimit"]["help"] = "Maximum number of parts in live playlists. (0 = infinite)"; - capa["optional"]["listlimit"]["default"] = 0ll; + capa["optional"]["listlimit"]["default"] = 0; capa["optional"]["listlimit"]["type"] = "uint"; capa["optional"]["listlimit"]["option"] = "--list-limit"; diff --git a/src/output/output_progressive_flv.cpp b/src/output/output_progressive_flv.cpp index 1fc2cc4e..8b651424 100644 --- a/src/output/output_progressive_flv.cpp +++ b/src/output/output_progressive_flv.cpp @@ -34,7 +34,7 @@ namespace Mist { JSON::Value opt; opt["arg"] = "string"; opt["default"] = ""; - opt["arg_num"] = 1ll; + opt["arg_num"] = 1; opt["help"] = "Target filename to store FLV file as, or - for stdout."; cfg->addOption("target", opt); diff --git a/src/output/output_rtmp.cpp b/src/output/output_rtmp.cpp index 3011cc97..47bd030e 100644 --- a/src/output/output_rtmp.cpp +++ b/src/output/output_rtmp.cpp @@ -86,7 +86,7 @@ namespace Mist{ amfReply.getContentP(2)->addContent(AMF::Object("type", "nonprivate")); amfReply.getContentP(2)->addContent(AMF::Object("flashVer", "FMLE/3.0 (compatible; MistServer/" PACKAGE_VERSION "/" RELEASE ")")); if (port != 1935){ - amfReply.getContentP(2)->addContent(AMF::Object("tcUrl", "rtmp://" + host + ":" + JSON::Value((long long)port).asString() + "/" + app)); + amfReply.getContentP(2)->addContent(AMF::Object("tcUrl", "rtmp://" + host + ":" + JSON::Value(port).asString() + "/" + app)); }else{ amfReply.getContentP(2)->addContent(AMF::Object("tcUrl", "rtmp://" + host + "/" + app)); } @@ -200,19 +200,19 @@ namespace Mist{ capa["optional"]["acceptable"]["help"] = "Whether to allow only incoming pushes (2), only outgoing pulls (1), or both (0, default)"; capa["optional"]["acceptable"]["option"] = "--acceptable"; capa["optional"]["acceptable"]["short"] = "T"; - capa["optional"]["acceptable"]["default"] = (long long)0; + capa["optional"]["acceptable"]["default"] = 0; capa["optional"]["acceptable"]["type"] = "select"; - capa["optional"]["acceptable"]["select"][0u][0u] = 0ll; + capa["optional"]["acceptable"]["select"][0u][0u] = 0; capa["optional"]["acceptable"]["select"][0u][1u] = "Allow both incoming and outgoing connections"; - capa["optional"]["acceptable"]["select"][1u][0u] = 1ll; + capa["optional"]["acceptable"]["select"][1u][0u] = 1; capa["optional"]["acceptable"]["select"][1u][1u] = "Allow only outgoing connections"; - capa["optional"]["acceptable"]["select"][2u][0u] = 2ll; + capa["optional"]["acceptable"]["select"][2u][0u] = 2; capa["optional"]["acceptable"]["select"][2u][1u] = "Allow only incoming connections"; capa["optional"]["maxkbps"]["name"] = "Max. kbps"; capa["optional"]["maxkbps"]["help"] = "Maximum bitrate to allow in the ingest direction, in kilobits per second."; capa["optional"]["maxkbps"]["option"] = "--maxkbps"; capa["optional"]["maxkbps"]["short"] = "K"; - capa["optional"]["maxkbps"]["default"] = (long long)0; + capa["optional"]["maxkbps"]["default"] = 0; capa["optional"]["maxkbps"]["type"] = "uint"; cfg->addConnectorOptions(1935, capa); config = cfg; @@ -221,7 +221,7 @@ namespace Mist{ JSON::Value opt; opt["arg"] = "string"; opt["default"] = ""; - opt["arg_num"] = 1ll; + opt["arg_num"] = 1; opt["help"] = "Target rtmp:// URL to push out towards."; cfg->addOption("target", opt); cfg->addOption("streamname", JSON::fromString("{\"arg\":\"string\",\"short\":\"s\",\"long\":\"stream\",\"help\":\"The name of the stream to push out, when pushing out.\"}")); diff --git a/src/output/output_rtsp.cpp b/src/output/output_rtsp.cpp index 47001029..befbd925 100644 --- a/src/output/output_rtsp.cpp +++ b/src/output/output_rtsp.cpp @@ -102,11 +102,11 @@ namespace Mist{ capa["methods"][0u]["handler"] = "rtsp"; capa["methods"][0u]["type"] = "rtsp"; - capa["methods"][0u]["priority"] = 2ll; + capa["methods"][0u]["priority"] = 2; capa["optional"]["maxsend"]["name"] = "Max RTP packet size"; capa["optional"]["maxsend"]["help"] = "Maximum size of RTP packets in bytes"; - capa["optional"]["maxsend"]["default"] = (long long)RTP::MAX_SEND; + capa["optional"]["maxsend"]["default"] = RTP::MAX_SEND; capa["optional"]["maxsend"]["type"] = "uint"; capa["optional"]["maxsend"]["option"] = "--max-packet-size"; capa["optional"]["maxsend"]["short"] = "m"; diff --git a/src/output/output_ts.cpp b/src/output/output_ts.cpp index 7151e172..809d29b5 100644 --- a/src/output/output_ts.cpp +++ b/src/output/output_ts.cpp @@ -94,7 +94,7 @@ namespace Mist { JSON::Value opt; opt["arg"] = "string"; opt["default"] = ""; - opt["arg_num"] = 1ll; + opt["arg_num"] = 1; opt["help"] = "Target tsudp:// URL to push out towards."; cfg->addOption("target", opt); } diff --git a/src/output/output_wav.cpp b/src/output/output_wav.cpp index 36ed5038..d75e4508 100644 --- a/src/output/output_wav.cpp +++ b/src/output/output_wav.cpp @@ -19,13 +19,13 @@ namespace Mist{ capa["codecs"][0u][0u].append("FLOAT"); capa["methods"][0u]["handler"] = "http"; capa["methods"][0u]["type"] = "html5/audio/wav"; - capa["methods"][0u]["priority"] = 1ll; + capa["methods"][0u]["priority"] = 1; capa["push_urls"].append("/*.wav"); JSON::Value opt; opt["arg"] = "string"; opt["default"] = ""; - opt["arg_num"] = 1ll; + opt["arg_num"] = 1; opt["help"] = "Target filename to store WAV file as, or - for stdout."; cfg->addOption("target", opt); }