From 4181b52857f9018a6598df4e0cfcc673e95beffa Mon Sep 17 00:00:00 2001 From: Thulinma Date: Wed, 26 Oct 2022 16:13:27 +0200 Subject: [PATCH] Silence more compile warnings, fix compilation on MacOS --- lib/bitfields.cpp | 2 -- lib/comms.cpp | 2 +- lib/dtsc.cpp | 6 +++--- lib/hls_support.cpp | 10 ++-------- lib/rtp.cpp | 2 +- lib/sdp.cpp | 2 +- lib/socket.cpp | 4 ++++ lib/stream.cpp | 4 ++-- lib/timing.cpp | 2 -- lib/util.h | 1 + src/analysers/analyser_ogg.cpp | 2 -- src/controller/controller_statistics.cpp | 2 +- src/input/input.cpp | 8 ++++---- src/input/input_aac.cpp | 20 ++++++++++---------- src/input/input_dtsc.cpp | 2 +- src/input/input_ebml.cpp | 2 -- src/input/input_hls.cpp | 2 +- src/input/input_ismv.cpp | 3 --- src/input/input_mp4.cpp | 2 +- src/input/input_sdp.cpp | 6 +++--- src/output/output.cpp | 2 +- src/output/output_cmaf.cpp | 4 ++-- src/output/output_dtsc.cpp | 2 +- src/output/output_h264.cpp | 6 +++--- src/output/output_hls.cpp | 4 ++-- src/output/output_http_internal.cpp | 2 +- src/output/output_json.cpp | 2 +- src/output/output_mp4.cpp | 6 +++--- src/output/output_tsrist.cpp | 2 +- src/output/output_tssrt.cpp | 2 +- src/output/output_webrtc.cpp | 6 +++--- src/process/process_exec.cpp | 4 ++-- src/process/process_livepeer.cpp | 4 ++-- src/utils/util_nuke.cpp | 4 ++-- 34 files changed, 61 insertions(+), 73 deletions(-) diff --git a/lib/bitfields.cpp b/lib/bitfields.cpp index be1a4d95..33291830 100644 --- a/lib/bitfields.cpp +++ b/lib/bitfields.cpp @@ -40,7 +40,6 @@ void Bit::setMSB(char *pointer, unsigned int offsetBits, unsigned int dataBits, pointer += (offsetBits + dataBits) >> 3; // The offset is now guaranteed less than a whole byte. offsetBits = (offsetBits + dataBits) & 0x07; - unsigned long long retVal = 0; // Now we set the remaining bytes while (dataBits){ // Calculate how many bits we're setting in this byte @@ -49,7 +48,6 @@ void Bit::setMSB(char *pointer, unsigned int offsetBits, unsigned int dataBits, // If that is too much, we use the remainder instead if (curBits > dataBits){curBits = dataBits;} // Set the current pointer position at the correct offset, increasing the pointer by one - retVal |= ((int)(*(pointer++)) << offsetBits) >> (8 - curBits); *pointer = (((*pointer) << offsetBits) >> offsetBits) | ((value & 0xFF) << (8 - offsetBits)); --pointer; // Finally, shift the current value by the amount of bits we're adding diff --git a/lib/comms.cpp b/lib/comms.cpp index 14faa980..1b4cfe2e 100644 --- a/lib/comms.cpp +++ b/lib/comms.cpp @@ -407,7 +407,7 @@ namespace Comms{ setConnector(protocol); setHost(ip); setStream(streamName); - VERYHIGH_MSG("Reloading connection. Claimed record %lu", index); + VERYHIGH_MSG("Reloading connection. Claimed record %" PRIu64, index); } } diff --git a/lib/dtsc.cpp b/lib/dtsc.cpp index 484ce2e4..5094a3b4 100644 --- a/lib/dtsc.cpp +++ b/lib/dtsc.cpp @@ -2836,8 +2836,8 @@ namespace DTSC{ trackJSON["codec"] = getCodec(*it); trackJSON["type"] = type; - trackJSON["idx"] = *it; - trackJSON["trackid"] = getID(*it); + trackJSON["idx"] = (uint64_t)*it; + trackJSON["trackid"] = (uint64_t)getID(*it); trackJSON["init"] = getInit(*it); trackJSON["firstms"] = getFirstms(*it); trackJSON["lastms"] = getLastms(*it); @@ -3288,7 +3288,7 @@ namespace DTSC{ if (trackValid(srcTrk)){ track["source"] = getTrackIdentifier(srcTrk); }else{ - track["source"] = "Invalid track " + JSON::Value(srcTrk).asString(); + track["source"] = "Invalid track " + JSON::Value((uint64_t)srcTrk).asString(); } }else{ if (jitter < minKeep){jitter = minKeep;} diff --git a/lib/hls_support.cpp b/lib/hls_support.cpp index 130e691d..66dc382a 100644 --- a/lib/hls_support.cpp +++ b/lib/hls_support.cpp @@ -114,7 +114,7 @@ namespace HLS{ uint64_t lastFragmentDur = getLastFragDur(M, userSelect, trackData, hlsMsnNr, fragments, keys); std::ldiv_t res = std::ldiv(lastFragmentDur, partDurationMaxMs); - DEBUG_MSG(5, "req MSN %" PRIu64 " fin MSN %zu, req Part %" PRIu64 " fin Part %zu", hlsMsnNr, + DEBUG_MSG(5, "req MSN %" PRIu64 " fin MSN %zu, req Part %" PRIu64 " fin Part %ld", hlsMsnNr, (fragments.getEndValid() - 2), hlsPartNr, res.quot); // BPR Time limit = 3x Target Duration (per HLS spec) @@ -300,13 +300,7 @@ namespace HLS{ /// Appends result with prependStr and timestamp calculated from current time in ms void addDateTimeTag(std::stringstream &result, const std::string &prependStr, const uint64_t unixMs){ - time_t uSecs = unixMs / 1000; - struct tm *ptm = gmtime(&uSecs); - char dt_iso_8601[25]; - snprintf(dt_iso_8601, 25, "%.4d-%.2d-%.2dT%.2d:%.2d:%.2d.%.3dZ", ptm->tm_year + 1900, - ptm->tm_mon + 1, ptm->tm_mday, ptm->tm_hour, ptm->tm_min, ptm->tm_sec, - (int)(unixMs % 1000)); - result << prependStr << dt_iso_8601 << "\r\n"; + result << prependStr << Util::getUTCStringMillis(unixMs) << "\r\n"; } /// Add segment tag to LLHLS playlist diff --git a/lib/rtp.cpp b/lib/rtp.cpp index 5a5ed829..4457a5ce 100644 --- a/lib/rtp.cpp +++ b/lib/rtp.cpp @@ -1273,7 +1273,7 @@ namespace RTP{ WARN_MSG("Ignoring invalid PPS packet! (%" PRIu32 "b)", len-4); return; } - HIGH_MSG("Updated PPS with ID %li from RTP data", PPS.picParameterSetId); + HIGH_MSG("Updated PPS with ID %" PRIu64 " from RTP data", PPS.picParameterSetId); ppsData[PPS.picParameterSetId].assign(buffer + 4, len - 4); } } diff --git a/lib/sdp.cpp b/lib/sdp.cpp index a194cd9e..987c9bda 100644 --- a/lib/sdp.cpp +++ b/lib/sdp.cpp @@ -877,7 +877,7 @@ namespace SDP{ for (std::map::iterator it = tracks.begin(); it != tracks.end(); it++) { trackID = myMeta->getID(it->first); - INFO_MSG("Removing track %zu:%s", it->first, myMeta->getTrackIdentifier(it->first).c_str()); + INFO_MSG("Removing track %" PRIu64 ":%s", it->first, myMeta->getTrackIdentifier(it->first).c_str()); if (trackID == INVALID_TRACK_ID){ WARN_MSG("TrackID was invalid"); } diff --git a/lib/socket.cpp b/lib/socket.cpp index aaefa2f2..f53ce93f 100644 --- a/lib/socket.cpp +++ b/lib/socket.cpp @@ -1626,6 +1626,7 @@ void Socket::UDPConnection::checkRecvBuf(){ setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (void*)&recvbuf, sizeof(recvbuf)); slen = sizeof(recvbuf); getsockopt(sock, SOL_SOCKET, SO_RCVBUF, (void*)&recvbuf, &slen); +#ifdef __linux__ #ifndef __CYGWIN__ if (recvbuf < 1024*1024){ recvbuf = 1024*1024; @@ -1633,12 +1634,14 @@ void Socket::UDPConnection::checkRecvBuf(){ slen = sizeof(recvbuf); getsockopt(sock, SOL_SOCKET, SO_RCVBUF, (void*)&recvbuf, &slen); } +#endif #endif if (recvbuf < 200*1024){ recvbuf = 200*1024; setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (void*)&recvbuf, sizeof(recvbuf)); slen = sizeof(recvbuf); getsockopt(sock, SOL_SOCKET, SO_RCVBUF, (void*)&recvbuf, &slen); +#ifdef __linux__ #ifndef __CYGWIN__ if (recvbuf < 200*1024){ recvbuf = 200*1024; @@ -1646,6 +1649,7 @@ void Socket::UDPConnection::checkRecvBuf(){ slen = sizeof(recvbuf); getsockopt(sock, SOL_SOCKET, SO_RCVBUF, (void*)&recvbuf, &slen); } +#endif #endif } if (recvbuf < 200*1024){ diff --git a/lib/stream.cpp b/lib/stream.cpp index 715015d6..ae835f3e 100644 --- a/lib/stream.cpp +++ b/lib/stream.cpp @@ -622,7 +622,7 @@ JSON::Value Util::getInputBySource(const std::string &filename, bool isProvider) // Abort if not available if (!inputs){ FAIL_MSG("Capabilities not available, aborting! Is MistController running?"); - return false; + return JSON::Value(); } // check in curConf for -priority/source_match @@ -863,7 +863,7 @@ std::set Util::pickTracks(const DTSC::Meta &M, const std::set tr //Literal track ID, does not check against trackList size_t idx = JSON::Value(trackVal).asInt(); - if (trackVal == JSON::Value(idx).asString()){ + if (trackVal == JSON::Value((uint64_t)idx).asString()){ if (!M.trackValid(idx)){ WARN_MSG("Track %zu does not exist in stream, cannot select", idx); return result; diff --git a/lib/timing.cpp b/lib/timing.cpp index afad58c1..a2d4396f 100644 --- a/lib/timing.cpp +++ b/lib/timing.cpp @@ -11,8 +11,6 @@ #if defined(__APPLE__) || defined(__MACH__) #include #include -#define CLOCK_REALTIME CALENDAR_CLOCK -#define CLOCK_MONOTONIC SYSTEM_CLOCK void clock_gettime(int ign, struct timespec *ts){ clock_serv_t cclock; mach_timespec_t mts; diff --git a/lib/util.h b/lib/util.h index d28a7f76..aedd9d7e 100644 --- a/lib/util.h +++ b/lib/util.h @@ -26,6 +26,7 @@ namespace Util{ virtual void dataCallback(const char *ptr, size_t size){ INFO_MSG("default callback, size: %zu", size); } + virtual ~DataCallback(){}; }; extern Util::DataCallback defaultDataCallback; diff --git a/src/analysers/analyser_ogg.cpp b/src/analysers/analyser_ogg.cpp index 51736401..b1b8a316 100644 --- a/src/analysers/analyser_ogg.cpp +++ b/src/analysers/analyser_ogg.cpp @@ -65,7 +65,6 @@ bool AnalyserOGG::parsePacket(){ } }else if (sn2Codec[oggPage.getBitstreamSerialNumber()] == "Opus"){ if (detail >= 2){std::cout << " Opus data" << std::endl;} - int offset = 0; for (unsigned int i = 0; i < oggPage.getAllSegments().size(); i++){ int len = oggPage.getAllSegments()[i].size(); const char *part = oggPage.getSegment(i); @@ -101,7 +100,6 @@ bool AnalyserOGG::parsePacket(){ }else{ if (detail >= 4){std::cout << " " << Opus::Opus_prettyPacket(part, len) << std::endl;} } - offset += len; } } return true; diff --git a/src/controller/controller_statistics.cpp b/src/controller/controller_statistics.cpp index 31cc5e06..df8c645d 100644 --- a/src/controller/controller_statistics.cpp +++ b/src/controller/controller_statistics.cpp @@ -1355,7 +1355,7 @@ void Controller::fillActive(JSON::Value &req, JSON::Value &rep){ }else if (j->asStringRef() == "tracks"){ if (!M || M.getStreamName() != it->first){M.reInit(it->first, false);} if (M){ - F = M.getValidTracks().size(); + F = (uint64_t)M.getValidTracks().size(); } }else if (j->asStringRef() == "status"){ uint8_t ss = Util::getStreamStatus(it->first); diff --git a/src/input/input.cpp b/src/input/input.cpp index 6dd19b46..338ca22c 100644 --- a/src/input/input.cpp +++ b/src/input/input.cpp @@ -1025,9 +1025,9 @@ namespace Mist{ void Input::finish(){ if (!standAlone || config->getBool("realtime")){return;} - for (std::map >::iterator it = pageCounter.begin(); + for (std::map >::iterator it = pageCounter.begin(); it != pageCounter.end(); it++){ - for (std::map::iterator it2 = it->second.begin(); it2 != it->second.end(); it2++){ + for (std::map::iterator it2 = it->second.begin(); it2 != it->second.end(); it2++){ it2->second = 1; } } @@ -1059,9 +1059,9 @@ namespace Mist{ } } //Check pages we buffered but forgot about - for (std::map >::iterator it = pageCounter.begin(); + for (std::map >::iterator it = pageCounter.begin(); it != pageCounter.end(); it++){ - for (std::map::iterator it2 = it->second.begin(); it2 != it->second.end(); it2++){ + for (std::map::iterator it2 = it->second.begin(); it2 != it->second.end(); it2++){ if (!checkedPages.count(it->first) || !checkedPages[it->first].count(it2->first)){ INFO_MSG("Deleting forgotten page %zu:%" PRIu32, it->first, it2->first); bufferRemove(it->first, it2->first); diff --git a/src/input/input_aac.cpp b/src/input/input_aac.cpp index cff14289..50fa21a5 100644 --- a/src/input/input_aac.cpp +++ b/src/input/input_aac.cpp @@ -163,7 +163,7 @@ namespace Mist{ inFile.readSome(aacData, bytesRead, frameSize - 6); if (bytesRead < frameSize - 6){ WARN_MSG("Not enough bytes left in buffer."); - WARN_MSG("Wanted %li bytes but read %li bytes...", frameSize - 6, bytesRead); + WARN_MSG("Wanted %" PRIu64 " bytes but read %zu bytes...", frameSize - 6, bytesRead); } for (int i = 0; i < (frameSize - 6); i++){ aacFrame[i+6] = aacData[i]; @@ -241,7 +241,7 @@ namespace Mist{ inFile.readSome(aacData, bytesRead, 6); if (bytesRead < 6){ WARN_MSG("Not enough bytes left in buffer to extract a new ADTS frame"); - WARN_MSG("Wanted %i bytes but read %li bytes...", 6, bytesRead); + WARN_MSG("Wanted 6 bytes but read %zu bytes...", bytesRead); WARN_MSG("Header contains bytes: %x %x %x %x %x %x", aacData[0] , aacData[1], aacData[2], aacData[3], aacData[4], aacData[5]); return; @@ -252,7 +252,7 @@ namespace Mist{ if (aacData[0] == 0x41 && aacData[1] == 0x50 && aacData[2] == 0x45 && aacData[3] == 0x54 && aacData[4] == 0x41 && aacData[5] == 0x47){ inFile.readAll(aacData, bytesRead); - INFO_MSG("Throwing out %li bytes of metadata...", bytesRead); + INFO_MSG("Throwing out %zu bytes of metadata...", bytesRead); return; } WARN_MSG("Invalid sync word at start of header"); @@ -270,7 +270,7 @@ namespace Mist{ inFile.readSome(aacData, bytesRead, frameSize - 6); if (bytesRead < frameSize - 6){ WARN_MSG("Not enough bytes left in buffer."); - WARN_MSG("Wanted %li bytes but read %li bytes...", frameSize - 6, bytesRead); + WARN_MSG("Wanted %" PRIu64 " bytes but read %zu bytes...", frameSize - 6, bytesRead); disregardAmount = frameSize - 6 - bytesRead; } for (int i = 0; i < (frameSize - 6); i++){ @@ -282,10 +282,10 @@ namespace Mist{ if (!adtsPack){ WARN_MSG("Could not parse ADTS package!"); WARN_MSG("Current frame info:"); - WARN_MSG("Current frame pos: %li", filePos); - WARN_MSG("Next frame pos: %li", nextFramePos); - WARN_MSG("Frame size expected: %li", frameSize); - WARN_MSG("Bytes read: %li", bytesRead); + WARN_MSG("Current frame pos: %zu", filePos); + WARN_MSG("Next frame pos: %zu", nextFramePos); + WARN_MSG("Frame size expected: %" PRIu64, frameSize); + WARN_MSG("Bytes read: %zu", bytesRead); WARN_MSG("ADTS getAACProfile: %li", adtsPack.getAACProfile()); WARN_MSG("ADTS getFrequencyIndex: %li", adtsPack.getFrequencyIndex()); WARN_MSG("ADTS getFrequency: %li", adtsPack.getFrequency()); @@ -326,8 +326,8 @@ namespace Mist{ // We minus the filePos by one, since we init it 1 higher inFile.seek(keys.getBpos(keyIdx)-1); thisTime = keys.getTime(keyIdx); - DONTEVEN_MSG("inputAAC wants to seek to timestamp %li on track %li", seekTime, idx); - DONTEVEN_MSG("inputAAC seeked to timestamp %f with bytePos %li", thisTime, keys.getBpos(keyIdx)-1); + DONTEVEN_MSG("inputAAC wants to seek to timestamp %" PRIu64 " on track %zu", seekTime, idx); + DONTEVEN_MSG("inputAAC seeked to timestamp %" PRIu64 " with bytePos %zu", thisTime, keys.getBpos(keyIdx)-1); } }// namespace Mist diff --git a/src/input/input_dtsc.cpp b/src/input/input_dtsc.cpp index bf7012db..ce945e5e 100644 --- a/src/input/input_dtsc.cpp +++ b/src/input/input_dtsc.cpp @@ -401,7 +401,7 @@ namespace Mist{ if (longest_key > shrtest_key*2){ JSON::Value prep; prep["cmd"] = "check_key_duration"; - prep["id"] = thisPacket.getTrackId(); + prep["id"] = (uint64_t)thisPacket.getTrackId(); prep["duration"] = longest_key; srcConn.SendNow("DTCM"); char sSize[4] ={0, 0, 0, 0}; diff --git a/src/input/input_ebml.cpp b/src/input/input_ebml.cpp index 958c1222..70658491 100644 --- a/src/input/input_ebml.cpp +++ b/src/input/input_ebml.cpp @@ -644,10 +644,8 @@ namespace Mist{ DTSC::Parts parts(M.parts(mainTrack)); uint64_t seekPos = keys.getBpos(0); // Replay the parts of the previous keyframe, so the timestaps match up - uint64_t partCount = 0; for (size_t i = 0; i < keys.getEndValid(); i++){ if (keys.getTime(i) > seekTime){break;} - partCount += keys.getParts(i); DONTEVEN_MSG("Seeking to %" PRIu64 ", found %" PRIu64 "...", seekTime, keys.getTime(i)); seekPos = keys.getBpos(i); } diff --git a/src/input/input_hls.cpp b/src/input/input_hls.cpp index 24d2719d..d23cdc61 100644 --- a/src/input/input_hls.cpp +++ b/src/input/input_hls.cpp @@ -886,7 +886,7 @@ namespace Mist{ // Write packet ID mappings JSON::Value thisMappingsR; - for (std::map::iterator pidIt = pidMappingR.begin(); + for (std::map::iterator pidIt = pidMappingR.begin(); pidIt != pidMappingR.end(); pidIt++){ thisMappingsR[JSON::Value(pidIt->first).asString()] = pidIt->second; } diff --git a/src/input/input_ismv.cpp b/src/input/input_ismv.cpp index 71084955..8d244943 100644 --- a/src/input/input_ismv.cpp +++ b/src/input/input_ismv.cpp @@ -60,7 +60,6 @@ namespace Mist{ std::map duration; - uint64_t currOffset; uint64_t lastBytePos = 0; uint64_t curBytePos = ftell(inFile); // parse fragments form here @@ -70,7 +69,6 @@ namespace Mist{ while (readMoofSkipMdat(tId, trunSamples) && !feof(inFile)){ if (!duration.count(tId)){duration[tId] = 0;} - currOffset = 8; for (std::vector::iterator it = trunSamples.begin(); it != trunSamples.end(); it++){ bool first = (it == trunSamples.begin()); @@ -86,7 +84,6 @@ namespace Mist{ meta.update(duration[tId] / 10000, offsetConv, tId, it->sampleSize, lastBytePos, first); duration[tId] += it->sampleDuration; - currOffset += it->sampleSize; } curBytePos = ftell(inFile); } diff --git a/src/input/input_mp4.cpp b/src/input/input_mp4.cpp index 5becc8c9..c8c8c21f 100644 --- a/src/input/input_mp4.cpp +++ b/src/input/input_mp4.cpp @@ -561,7 +561,7 @@ namespace Mist{ } static JSON::Value thisPack; thisPack.null(); - thisPack["trackid"] = curPart.trackID; + thisPack["trackid"] = (uint64_t)curPart.trackID; thisPack["bpos"] = curPart.bpos; //(long long)fileSource.tellg(); thisPack["data"] = std::string(readBuffer + (curPart.bpos-readPos) + 2, txtLen); thisPack["time"] = curPart.time; diff --git a/src/input/input_sdp.cpp b/src/input/input_sdp.cpp index 0072cbeb..4132905b 100644 --- a/src/input/input_sdp.cpp +++ b/src/input/input_sdp.cpp @@ -99,7 +99,7 @@ namespace Mist{ } reader.readAll(buffer, bytesRead); - HIGH_MSG("Downloaded SDP file (%lu B)", bytesRead); + HIGH_MSG("Downloaded SDP file (%zu B)", bytesRead); // Save old buffer in order to identify changes oldBuffer = strdup(buffer); @@ -157,7 +157,7 @@ namespace Mist{ // Re-read SDP file reader.readAll(buffer, bytesRead); // Re-init SPD state iff contents have changed - INFO_MSG("Downloaded SDP file (%lu B)", bytesRead); + INFO_MSG("Downloaded SDP file (%zu B)", bytesRead); if (bytesRead != 0){ if (!compareStrings(oldBuffer, buffer)){ INFO_MSG("SDP contents have changed. Reparsing SDP file"); @@ -302,7 +302,7 @@ namespace Mist{ pkt.getString("data", pktData, pktDataLen); size_t idx = M.trackIDToIndex(pkt.getTrackId(), getpid()); - HIGH_MSG("Buffering new pkt for track %zu->%zu at offset %zu and time %zu", pkt.getTrackId(), idx, packetOffset, pkt.getTime()); + HIGH_MSG("Buffering new pkt for track %zu->%zu at offset %" PRId64 " and time %" PRIu64, pkt.getTrackId(), idx, packetOffset, pkt.getTime()); if (idx == INVALID_TRACK_ID){ INFO_MSG("Invalid index for track number %zu", pkt.getTrackId()); diff --git a/src/output/output.cpp b/src/output/output.cpp index 307c6b8c..ecdcfb5d 100644 --- a/src/output/output.cpp +++ b/src/output/output.cpp @@ -1752,7 +1752,7 @@ namespace Mist{ JSON::Value & pData = pStat["push_status_update"]["status"]; pData["mediatime"] = currentTime(); for (std::map::iterator it = userSelect.begin(); it != userSelect.end(); it++){ - pData["tracks"].append(it->first); + pData["tracks"].append((uint64_t)it->first); } pData["bytes"] = statComm.getUp(); uint64_t pktCntNow = statComm.getPacketCount(); diff --git a/src/output/output_cmaf.cpp b/src/output/output_cmaf.cpp index fa046db5..4d2636cf 100644 --- a/src/output/output_cmaf.cpp +++ b/src/output/output_cmaf.cpp @@ -274,8 +274,8 @@ namespace Mist{ timingTid, requestTid, M.biggestFragment(timingTid) / 1000, - atol(H.GetVar("iMsn").c_str()), - M.getLive()? config->getInteger("listlimit") : 0, + (uint64_t)atol(H.GetVar("iMsn").c_str()), + (uint64_t)(M.getLive() ? config->getInteger("listlimit") : 0), urlPrefix, systemBoot, bootMsOffset, diff --git a/src/output/output_dtsc.cpp b/src/output/output_dtsc.cpp index b1e79c17..03e26601 100644 --- a/src/output/output_dtsc.cpp +++ b/src/output/output_dtsc.cpp @@ -209,7 +209,7 @@ namespace Mist{ if (kDur > longest_key){longest_key = kDur;} } if (dur > longest_key*1.2){ - onFail("Key duration mismatch; disconnecting "+myConn.getHost()+" to recover ("+JSON::Value(longest_key).asString()+" -> "+JSON::Value(dur).asString()+")", true); + onFail("Key duration mismatch; disconnecting "+myConn.getHost()+" to recover ("+JSON::Value(longest_key).asString()+" -> "+JSON::Value((uint64_t)dur).asString()+")", true); return; }else{ sendOk("Key duration matches upstream"); diff --git a/src/output/output_h264.cpp b/src/output/output_h264.cpp index 518b66ee..5520f7a2 100644 --- a/src/output/output_h264.cpp +++ b/src/output/output_h264.cpp @@ -195,7 +195,7 @@ namespace Mist{ continue; } r["data"]["codecs"].append(codec); - r["data"]["tracks"].append(it->first); + r["data"]["tracks"].append((uint64_t)it->first); ++it; } webSock->sendFrame(r.toString()); @@ -305,7 +305,7 @@ namespace Mist{ } } for (std::map::iterator it = userSelect.begin(); it != userSelect.end(); it++){ - r["data"]["tracks"].append(it->first); + r["data"]["tracks"].append((uint64_t)it->first); } webSock->sendFrame(r.toString()); } @@ -448,7 +448,7 @@ namespace Mist{ r["type"] = "info"; r["data"]["msg"] = "Sending header"; for (std::map::iterator it = userSelect.begin(); it != userSelect.end(); it++){ - r["data"]["tracks"].append(it->first); + r["data"]["tracks"].append((uint64_t)it->first); } webSock->sendFrame(r.toString()); diff --git a/src/output/output_hls.cpp b/src/output/output_hls.cpp index 112e7ee2..b0165b5f 100644 --- a/src/output/output_hls.cpp +++ b/src/output/output_hls.cpp @@ -161,8 +161,8 @@ namespace Mist{ timingTid, requestTid, M.biggestFragment(timingTid) / 1000, - atol(H.GetVar("iMsn").c_str()), - M.getLive()? config->getInteger("listlimit") : 0, + (uint64_t)atol(H.GetVar("iMsn").c_str()), + (uint64_t)(M.getLive() ? config->getInteger("listlimit") : 0), urlPrefix, systemBoot, bootMsOffset, diff --git a/src/output/output_http_internal.cpp b/src/output/output_http_internal.cpp index be955196..79ce6c0e 100644 --- a/src/output/output_http_internal.cpp +++ b/src/output/output_http_internal.cpp @@ -773,7 +773,7 @@ namespace Mist{ std::set validTracks = M.getValidTracks(); for (std::set::iterator it = validTracks.begin(); it != validTracks.end(); it++){ if (M.getType(*it) == "video"){ - trackSources += "