diff --git a/lib/cmaf.cpp b/lib/cmaf.cpp index ec4271cf..a8c01775 100644 --- a/lib/cmaf.cpp +++ b/lib/cmaf.cpp @@ -410,7 +410,10 @@ namespace CMAF{ trunBox.setSampleInformation(sampleInfo, trunOffset++); } }else{ - WARN_MSG("Empty CMAF header for track %zu: %zu-%zu contains no packets (first: %" PRIu64 ", last: %" PRIu64 "), firstPart=%zu, lastPart=%zu", track, startTime, endTime, M.getFirstms(track), M.getLastms(track), firstPart, endPart); + WARN_MSG("Empty CMAF header for track %zu: %" PRIu64 "-%" PRIu64 " contains no packets (first: %" PRIu64 + ", last: %" PRIu64 "), firstPart=%zu, lastPart=%zu", + track, startTime, endTime, M.getFirstms(track), M.getLastms(track), firstPart, + endPart); } trafBox.setContent(trunBox, 2); diff --git a/lib/comms.h b/lib/comms.h index a3f1b7b5..9f459422 100644 --- a/lib/comms.h +++ b/lib/comms.h @@ -55,7 +55,7 @@ namespace Comms{ protected: bool master; - size_t index; + uint64_t index; size_t currentSize; IPC::semaphore sem; IPC::sharedPage dataPage; diff --git a/lib/dtsc.cpp b/lib/dtsc.cpp index c9378ed9..0b3228c9 100644 --- a/lib/dtsc.cpp +++ b/lib/dtsc.cpp @@ -318,7 +318,7 @@ namespace DTSC{ Bit::htobl(data + offset, Bit::btohl(data + offset) + appendLen); } - size_t Packet::getDataStringLen(){return Bit::btohl(data + getDataStringLenOffset());} + uint32_t Packet::getDataStringLen(){return Bit::btohl(data + getDataStringLenOffset());} /// Method can only be used when using internal functions to build the data. size_t Packet::getDataStringLenOffset(){ @@ -472,11 +472,11 @@ namespace DTSC{ ///\brief Returns the size of this packet. ///\return The size of this packet. - uint64_t Packet::getDataLen() const{return dataLen;} + uint32_t Packet::getDataLen() const{return dataLen;} ///\brief Returns the size of the payload of this packet. ///\return The size of the payload of this packet. - size_t Packet::getPayloadLen() const{ + uint32_t Packet::getPayloadLen() const{ if (version == DTSC_V2){ return dataLen - 20; }else{ diff --git a/lib/dtsc.h b/lib/dtsc.h index 7523b545..2f05fe3c 100644 --- a/lib/dtsc.h +++ b/lib/dtsc.h @@ -123,9 +123,9 @@ namespace DTSC{ void nullMember(const std::string & memb); size_t getTrackId() const; char *getData() const; - size_t getDataLen() const; - size_t getPayloadLen() const; - size_t getDataStringLen(); + uint32_t getDataLen() const; + uint32_t getPayloadLen() const; + uint32_t getDataStringLen(); size_t getDataStringLenOffset(); JSON::Value toJSON() const; std::string toSummary() const; @@ -136,8 +136,8 @@ namespace DTSC{ packType version; void resize(size_t size); char *data; - size_t bufferLen; - size_t dataLen; + uint32_t bufferLen; + uint32_t dataLen; uint64_t prevNalSize; }; diff --git a/lib/flv_tag.cpp b/lib/flv_tag.cpp index 5d85b419..b3b81f94 100644 --- a/lib/flv_tag.cpp +++ b/lib/flv_tag.cpp @@ -493,14 +493,14 @@ bool FLV::Tag::DTSCAudioInit(const std::string & codec, unsigned int sampleRate, return true; } -bool FLV::Tag::DTSCMetaInit(const DTSC::Meta &M, std::set &selTracks){ +bool FLV::Tag::DTSCMetaInit(const DTSC::Meta &M, std::set &selTracks){ AMF::Object amfdata("root", AMF::AMF0_DDV_CONTAINER); amfdata.addContent(AMF::Object("", "onMetaData")); amfdata.addContent(AMF::Object("", AMF::AMF0_ECMA_ARRAY)); AMF::Object trinfo = AMF::Object("trackinfo", AMF::AMF0_STRICT_ARRAY); int i = 0; uint64_t mediaLen = 0; - for (std::set::iterator it = selTracks.begin(); it != selTracks.end(); it++){ + for (std::set::iterator it = selTracks.begin(); it != selTracks.end(); it++){ if (M.getLastms(*it) - M.getFirstms(*it) > mediaLen){ mediaLen = M.getLastms(*it) - M.getFirstms(*it); } diff --git a/lib/flv_tag.h b/lib/flv_tag.h index bea495ea..ca27f472 100644 --- a/lib/flv_tag.h +++ b/lib/flv_tag.h @@ -52,7 +52,7 @@ namespace FLV{ bool DTSCLoader(DTSC::Packet &packData, const DTSC::Meta &M, size_t idx); bool DTSCVideoInit(DTSC::Meta &meta, uint32_t vTrack); bool DTSCAudioInit(const std::string & codec, unsigned int sampleRate, unsigned int sampleSize, unsigned int channels, const std::string & initData); - bool DTSCMetaInit(const DTSC::Meta &M, std::set &selTracks); + bool DTSCMetaInit(const DTSC::Meta &M, std::set &selTracks); void toMeta(DTSC::Meta &meta, AMF::Object &amf_storage); void toMeta(DTSC::Meta &meta, AMF::Object &amf_storage, size_t &reTrack, const std::map &targetParams); bool MemLoader(char *D, unsigned int S, unsigned int &P); diff --git a/lib/h264.cpp b/lib/h264.cpp index 76948a54..63c92c49 100644 --- a/lib/h264.cpp +++ b/lib/h264.cpp @@ -38,10 +38,10 @@ namespace h264{ return false; } - std::deque analysePackets(const char *data, unsigned long len){ + std::deque analysePackets(const char *data, size_t len){ std::deque res; - int offset = 0; + size_t offset = 0; // Make sure entire packet is within len while (offset + 5 < len && Bit::btohl(data + offset) + offset + 4 <= len){ nalu::nalData entry; diff --git a/lib/mp4.cpp b/lib/mp4.cpp index 38a49a2c..033f7f71 100644 --- a/lib/mp4.cpp +++ b/lib/mp4.cpp @@ -110,7 +110,7 @@ namespace MP4{ fseek(newData, 0, SEEK_END); return true; } - DONTEVEN_MSG("skipping size 0x%.8lX", size); + DONTEVEN_MSG("skipping box of size %" PRIu64, size); if (fseek(newData, pos + size, SEEK_SET) == 0){ return true; }else{ diff --git a/lib/mp4_generic.cpp b/lib/mp4_generic.cpp index d6fd2008..9822e4c2 100644 --- a/lib/mp4_generic.cpp +++ b/lib/mp4_generic.cpp @@ -2772,7 +2772,7 @@ namespace MP4{ if (count == index){ setBox(box, offset); }else{ - INFO_MSG("Should not be here! Index is %zu, count is %zu, offset is %zu, payloadSize is %zu", + INFO_MSG("Should not be here! Index is %zu, count is %zu, offset is %zu, payloadSize is %" PRIu64, index, count, offset, payloadSize()); } } @@ -2916,7 +2916,7 @@ namespace MP4{ if (count == index){ setBox(box, offset); }else{ - INFO_MSG("Should not be here! Index is %zu, count is %zu, offset is %zu, payloadSize is %zu", + INFO_MSG("Should not be here! Index is %zu, count is %zu, offset is %zu, payloadSize is %" PRIu64, index, count, offset, payloadSize()); } } diff --git a/lib/ogg.cpp b/lib/ogg.cpp index 426ddf9b..fcca9e9a 100644 --- a/lib/ogg.cpp +++ b/lib/ogg.cpp @@ -98,8 +98,8 @@ namespace OGG{ /// Reads an OGG Page from the source and if valid, removes it from source. bool Page::read(std::string &newData){ - int len = newData.size(); - int total = 0; + size_t len = newData.size(); + size_t total = 0; segments.clear(); if (newData.size() < 27){return false;} if (newData.substr(0, 4) != "OggS"){ @@ -127,7 +127,7 @@ namespace OGG{ newData.erase(0, *it); } - INFO_MSG("Erased %lu bytes from the input", len - newData.size()); + INFO_MSG("Erased %zu bytes from the input", len - newData.size()); return true; } @@ -203,12 +203,12 @@ namespace OGG{ void Page::setGranulePosition(long long unsigned int newVal){set_64(data + 6, newVal);} - long unsigned int Page::getBitstreamSerialNumber(){ + uint32_t Page::getBitstreamSerialNumber(){ // return ntohl(((long unsigned int*)(data+14))[0]); return get_32(data + 14); } - void Page::setBitstreamSerialNumber(long unsigned int newVal){set_32(data + 14, newVal);} + void Page::setBitstreamSerialNumber(uint32_t newVal){set_32(data + 14, newVal);} long unsigned int Page::getPageSequenceNumber(){return get_32(data + 18);} diff --git a/lib/ogg.h b/lib/ogg.h index 719bb119..031b8fca 100644 --- a/lib/ogg.h +++ b/lib/ogg.h @@ -45,8 +45,8 @@ namespace OGG{ void setHeaderType(char newVal); long long unsigned int getGranulePosition(); void setGranulePosition(long long unsigned int newVal); - long unsigned int getBitstreamSerialNumber(); - void setBitstreamSerialNumber(long unsigned int newVal); + uint32_t getBitstreamSerialNumber(); + void setBitstreamSerialNumber(uint32_t newVal); long unsigned int getCRCChecksum(); void setCRCChecksum(long unsigned int newVal); long unsigned int getPageSequenceNumber(); diff --git a/lib/rtmpchunks.cpp b/lib/rtmpchunks.cpp index d8160fff..e7c151f0 100644 --- a/lib/rtmpchunks.cpp +++ b/lib/rtmpchunks.cpp @@ -498,7 +498,7 @@ bool RTMPStream::doHandshake(){ char Version; // Read C0 if (handshake_in.size() < 1537){ - FAIL_MSG("Handshake wasn't filled properly (%lu/1537) - aborting!", handshake_in.size()); + FAIL_MSG("Handshake wasn't filled properly (%zu/1537) - aborting!", handshake_in.size()); return false; } Version = RTMPStream::handshake_in[0]; diff --git a/lib/rtp.cpp b/lib/rtp.cpp index c8f454a8..8f4c6ca5 100644 --- a/lib/rtp.cpp +++ b/lib/rtp.cpp @@ -771,7 +771,7 @@ namespace RTP{ return; } if (fuaBuffer.size() && ((pl[2] & 0x80) || missed)){ - WARN_MSG("H265 FU packet incompleted: %lu", fuaBuffer.size()); + WARN_MSG("H265 FU packet incompleted: %zu", fuaBuffer.size()); Bit::htobl(fuaBuffer, fuaBuffer.size() - 4); // size-prepend fuaBuffer[4] |= 0x80; // set error bit handleHEVCSingle(msTime, fuaBuffer, fuaBuffer.size(), @@ -794,7 +794,7 @@ namespace RTP{ } if (pl[2] & 0x40){// last packet - VERYHIGH_MSG("H265 FU packet type %s (%u) completed: %lu", + VERYHIGH_MSG("H265 FU packet type %s (%u) completed: %zu", h265::typeToStr((fuaBuffer[4] & 0x7E) >> 1), (uint8_t)((fuaBuffer[4] & 0x7E) >> 1), fuaBuffer.size()); Bit::htobl(fuaBuffer, fuaBuffer.size() - 4); // size-prepend @@ -923,7 +923,7 @@ namespace RTP{ } if (fuaBuffer.size() && ((pl[1] & 0x80) || missed)){ WARN_MSG("Ending unfinished FU-A"); - INSANE_MSG("H264 FU-A packet incompleted: %lu", fuaBuffer.size()); + INSANE_MSG("H264 FU-A packet incompleted: %zu", fuaBuffer.size()); fuaBuffer.truncate(0); return; } @@ -941,7 +941,7 @@ namespace RTP{ } if (pl[1] & 0x40){// last packet - INSANE_MSG("H264 FU-A packet type %u completed: %lu", (unsigned int)(fuaBuffer[4] & 0x1F), + INSANE_MSG("H264 FU-A packet type %u completed: %zu", (unsigned int)(fuaBuffer[4] & 0x1F), fuaBuffer.size()); uint8_t nalType = (fuaBuffer[4] & 0x1F); if (nalType == 7 || nalType == 8){ diff --git a/lib/sdp.cpp b/lib/sdp.cpp index 6fff3dbe..a6ae716b 100644 --- a/lib/sdp.cpp +++ b/lib/sdp.cpp @@ -607,10 +607,10 @@ namespace SDP{ } /// Calculates H265 track metadata from sps and pps data stored in tracks[trackNo] - void State::updateH265Init(size_t tid){ + void State::updateH265Init(uint64_t tid){ SDP::Track &RTrk = tracks[tid]; if (!RTrk.hevcInfo.haveRequired()){ - MEDIUM_MSG("Aborted meta fill for hevc track %lu: no info nal unit", tid); + MEDIUM_MSG("Aborted meta fill for hevc track %" PRIu64 ": no info nal unit", tid); return; } myMeta->setInit(tid, RTrk.hevcInfo.generateHVCC()); @@ -647,7 +647,7 @@ namespace SDP{ } size_t State::getTrackNoForChannel(uint8_t chan){ - for (std::map::iterator it = tracks.begin(); it != tracks.end(); ++it){ + for (std::map::iterator it = tracks.begin(); it != tracks.end(); ++it){ if (chan == it->second.channel){return it->first;} } return INVALID_TRACK_ID; @@ -671,7 +671,7 @@ namespace SDP{ while (loop){ if (tracks.size()){ - for (std::map::iterator it = tracks.begin(); it != tracks.end(); ++it){ + for (std::map::iterator it = tracks.begin(); it != tracks.end(); ++it){ if (!it->second.control.size()){ it->second.control = "/track" + JSON::Value(it->first).asString(); INFO_MSG("Control track: %s", it->second.control.c_str()); @@ -681,7 +681,7 @@ namespace SDP{ urlString.substr(urlString.size() - it->second.control.size()) == it->second.control) || (pw.size() >= it->second.control.size() && pw.substr(pw.size() - it->second.control.size()) == it->second.control)){ - INFO_MSG("Parsing SETUP against track %lu", it->first); + INFO_MSG("Parsing SETUP against track %" PRIu64, it->first); if (!it->second.parseTransport(H.GetHeader("Transport"), cH, src, myMeta, it->first)){ return INVALID_TRACK_ID; } @@ -720,7 +720,7 @@ namespace SDP{ return ((double)M->getRate(tid) / 1000.0); } - void State::updateInit(const size_t tid, const std::string &initData){ + void State::updateInit(const uint64_t tid, const std::string &initData){ myMeta->setInit(tid, initData.data(), initData.size()); } diff --git a/lib/sdp.h b/lib/sdp.h index 0de371c6..4560aeca 100644 --- a/lib/sdp.h +++ b/lib/sdp.h @@ -47,8 +47,8 @@ namespace SDP{ void (*incomingPacketCallback)(const DTSC::Packet &pkt); void parseSDP(const std::string &sdp); void parseSDPEx(const std::string &sdp); - void updateH264Init(size_t trackNo); - void updateH265Init(size_t tid); + void updateH264Init(uint64_t trackNo); + void updateH265Init(uint64_t trackNo); void updateInit(const uint64_t trackNo, const std::string &initData); size_t getTrackNoForChannel(uint8_t chan); size_t parseSetup(HTTP::Parser &H, const std::string &host, const std::string &source); @@ -56,8 +56,8 @@ namespace SDP{ public: DTSC::Meta *myMeta; - std::map tConv; ///< Converters to DTSC - std::map tracks; ///< List of selected tracks with SDP-specific session data. + std::map tConv; ///< Converters to DTSC + std::map tracks; ///< List of selected tracks with SDP-specific session data. }; std::string mediaDescription(const DTSC::Meta *M, size_t tid); diff --git a/lib/sdp_media.cpp b/lib/sdp_media.cpp index 8f7f2d40..86214c80 100644 --- a/lib/sdp_media.cpp +++ b/lib/sdp_media.cpp @@ -847,7 +847,7 @@ namespace SDP{ M.setType(tid, "video"); M.setRate(tid, answerVideoFormat.getVideoRate()); M.setID(tid, answerVideoFormat.payloadType); - INFO_MSG("Setup video track %zu for payload type %zu", tid, answerVideoFormat.payloadType); + INFO_MSG("Setup video track %zu for payload type %" PRIu64, tid, answerVideoFormat.payloadType); return true; } @@ -869,7 +869,7 @@ namespace SDP{ M.setChannels(tid, answerAudioFormat.getAudioNumChannels()); M.setSize(tid, answerAudioFormat.getAudioBitSize()); M.setID(tid, answerAudioFormat.payloadType); - INFO_MSG("Setup audio track %zu for payload time %zu", tid, answerAudioFormat.payloadType); + INFO_MSG("Setup audio track %zu for payload time %" PRIu64, tid, answerAudioFormat.payloadType); return true; } @@ -1017,8 +1017,8 @@ namespace SDP{ usedProfile = "42e01f"; } - addLine("a=fmtp:%u profile-level-id=%s;level-asymmetry-allowed=1;packetization-mode=1", - fmtMedia->payloadType, usedProfile.c_str()); + addLine("a=fmtp:%u profile-level-id=42e01f;level-asymmetry-allowed=1;packetization-mode=1", + fmtMedia->payloadType); }else if (fmtMedia->encodingName == "OPUS"){ addLine("a=fmtp:%u minptime=10;useinbandfec=1", fmtMedia->payloadType); } diff --git a/lib/stream.cpp b/lib/stream.cpp index 11832446..c0332780 100644 --- a/lib/stream.cpp +++ b/lib/stream.cpp @@ -331,7 +331,7 @@ void Util::packetSorter::getTrackList(std::set &toFill) const{ JSON::Value Util::getStreamConfig(const std::string &streamname){ JSON::Value result; if (streamname.size() > 100){ - FAIL_MSG("Stream opening denied: %s is longer than 100 characters (%lu).", streamname.c_str(), + FAIL_MSG("Stream opening denied: %s is longer than 100 characters (%zu).", streamname.c_str(), streamname.size()); return result; } @@ -408,7 +408,7 @@ bool Util::startInput(std::string streamname, std::string filename, bool forkFir const std::map &overrides, pid_t *spawn_pid){ sanitizeName(streamname); if (streamname.size() > 100){ - FAIL_MSG("Stream opening denied: %s is longer than 100 characters (%lu).", streamname.c_str(), + FAIL_MSG("Stream opening denied: %s is longer than 100 characters (%zu).", streamname.c_str(), streamname.size()); return false; } diff --git a/lib/ts_packet.cpp b/lib/ts_packet.cpp index 94ed7ff0..f4039af8 100644 --- a/lib/ts_packet.cpp +++ b/lib/ts_packet.cpp @@ -1369,13 +1369,13 @@ namespace TS{ ///\param selectedTracks tracks to include in PMT creation ///\param myMeta ///\returns character pointer to a static 188B TS packet - const char *createPMT(std::set &selectedTracks, const DTSC::Meta &M, int contCounter){ + const char *createPMT(std::set &selectedTracks, const DTSC::Meta &M, int contCounter){ static ProgramMappingTable PMT; PMT.setPID(4096); PMT.setTableId(2); // section length met 2 tracks: 0xB017 int sectionLen = 0; - for (std::set::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){ + for (std::set::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){ std::string codec = M.getCodec(*it); sectionLen += 5; if (codec == "ID3" || codec == "RAW"){sectionLen += M.getInit(*it).size();} @@ -1394,7 +1394,7 @@ namespace TS{ PMT.setLastSectionNumber(0); PMT.setContinuityCounter(contCounter); int vidTrack = -1; - for (std::set::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){ + for (std::set::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){ if (M.getType(*it) == "video"){ vidTrack = *it; break; @@ -1404,7 +1404,7 @@ namespace TS{ PMT.setPCRPID(getUniqTrackID(M, vidTrack)); PMT.setProgramInfoLength(0); ProgramMappingEntry entry = PMT.getEntry(0); - for (std::set::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){ + for (std::set::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){ std::string codec = M.getCodec(*it); entry.setElementaryPid(getUniqTrackID(M, *it)); std::string es_info; diff --git a/lib/ts_packet.h b/lib/ts_packet.h index a74f4b38..bd098718 100644 --- a/lib/ts_packet.h +++ b/lib/ts_packet.h @@ -255,7 +255,7 @@ namespace TS{ size_t getUniqTrackID(const DTSC::Meta &M, size_t idx); - const char *createPMT(std::set &selectedTracks, const DTSC::Meta &M, int contCounter = 0); + const char *createPMT(std::set &selectedTracks, const DTSC::Meta &M, int contCounter = 0); const char *createSDT(const std::string &streamName, int contCounter = 0); }// namespace TS diff --git a/lib/ts_stream.cpp b/lib/ts_stream.cpp index 79cf4478..1cab14e1 100644 --- a/lib/ts_stream.cpp +++ b/lib/ts_stream.cpp @@ -635,7 +635,7 @@ namespace TS{ offset += pesPayload[offset] + 1; } if (realPayloadSize < offset+packSize){ - WARN_MSG("Encountered invalid Opus frame (%zu > %zu) - discarding!", offset+packSize, realPayloadSize); + WARN_MSG("Encountered invalid Opus frame (%zu > %" PRIu64 ") - discarding!", offset+packSize, realPayloadSize); break; } out.push_back(DTSC::Packet()); @@ -783,7 +783,7 @@ namespace TS{ } if (!packetReady){ - ERROR_MSG("Track %lu: PES without valid packets?", tid); + ERROR_MSG("Track %zu: PES without valid packets?", tid); return; } @@ -955,7 +955,7 @@ namespace TS{ switch (it->second){ case H264:{ if (!spsInfo.count(it->first) || !ppsInfo.count(it->first)){ - MEDIUM_MSG("Aborted meta fill for h264 track %lu: no SPS/PPS", it->first); + MEDIUM_MSG("Aborted meta fill for h264 track %zu: no SPS/PPS", it->first); continue; } // First generate needed data @@ -984,7 +984,7 @@ namespace TS{ }break; case H265:{ if (!hevcInfo.count(it->first) || !hevcInfo[it->first].haveRequired()){ - MEDIUM_MSG("Aborted meta fill for hevc track %lu: no info nal unit", it->first); + MEDIUM_MSG("Aborted meta fill for hevc track %zu: no info nal unit", it->first); continue; } addNewTrack = true; @@ -1123,7 +1123,7 @@ namespace TS{ entry.advance(); } } - MEDIUM_MSG("Initialized track %lu as %s %s", idx, codec.c_str(), type.c_str()); + MEDIUM_MSG("Initialized track %zu as %s %s", idx, codec.c_str(), type.c_str()); } } diff --git a/src/analysers/analyser_h264.cpp b/src/analysers/analyser_h264.cpp index 42d46c22..e496f6a9 100644 --- a/src/analysers/analyser_h264.cpp +++ b/src/analysers/analyser_h264.cpp @@ -39,7 +39,7 @@ bool AnalyserH264::parsePacket(){ FAIL_MSG("Could not read a NAL unit at position %" PRIu64, prePos); return false; } - HIGH_MSG("Read a %lu-byte NAL unit at position %" PRIu64, size, prePos); + HIGH_MSG("Read a %zu-byte NAL unit at position %" PRIu64, size, prePos); if (detail >= 2){nalPtr->toPrettyString(std::cout);} //SPS unit? Find the FPS, if any. if (nalPtr->getType() == 7){ diff --git a/src/analysers/analyser_hls.cpp b/src/analysers/analyser_hls.cpp index d185d558..18902ec5 100644 --- a/src/analysers/analyser_hls.cpp +++ b/src/analysers/analyser_hls.cpp @@ -105,7 +105,7 @@ bool AnalyserHLS::parsePacket(){ if (!DL.get(part.uri)){return false;} if (DL.getHeader("Content-Length") != ""){ if (DL.data().size() != atoi(DL.getHeader("Content-Length").c_str())){ - FAIL_MSG("Expected %s bytes of data, but only received %lu.", + FAIL_MSG("Expected %s bytes of data, but only received %zu.", DL.getHeader("Content-Length").c_str(), DL.data().size()); return false; } diff --git a/src/analysers/analyser_ogg.cpp b/src/analysers/analyser_ogg.cpp index c4774a82..51736401 100644 --- a/src/analysers/analyser_ogg.cpp +++ b/src/analysers/analyser_ogg.cpp @@ -28,10 +28,10 @@ bool AnalyserOGG::parsePacket(){ sn2Codec[oggPage.getBitstreamSerialNumber()] = "Opus"; } if (sn2Codec[oggPage.getBitstreamSerialNumber()] != ""){ - INFO_MSG("Bitstream %" PRIu64 " recognized as %s", oggPage.getBitstreamSerialNumber(), + INFO_MSG("Bitstream %" PRIu32 " recognized as %s", oggPage.getBitstreamSerialNumber(), sn2Codec[oggPage.getBitstreamSerialNumber()].c_str()); }else{ - WARN_MSG("Bitstream %" PRIu64 " not recognized!", oggPage.getBitstreamSerialNumber()); + WARN_MSG("Bitstream %" PRIu32 " not recognized!", oggPage.getBitstreamSerialNumber()); } } diff --git a/src/analysers/analyser_rtmp.cpp b/src/analysers/analyser_rtmp.cpp index 38c1a342..7c3a08e8 100644 --- a/src/analysers/analyser_rtmp.cpp +++ b/src/analysers/analyser_rtmp.cpp @@ -67,17 +67,17 @@ bool AnalyserRTMP::parsePacket(){ } // We now know for sure that we've parsed a packet - DETAIL_HI("Chunk info: [%#2X] CS ID %u, timestamp %u, len %u, type ID %u, Stream ID %u", + DETAIL_HI("Chunk info: [%#2X] CS ID %u, timestamp %" PRIu64 ", len %u, type ID %u, Stream ID %u", next.headertype, next.cs_id, next.timestamp, next.len, next.msg_type_id, next.msg_stream_id); switch (next.msg_type_id){ case 0: // does not exist - DETAIL_LOW("Error chunk @ %lu - CS%i, T%i, L%i, LL%i, MID%i", read_in - strbuf.size(), + DETAIL_LOW("Error chunk @ %zu - CS%u, T%" PRIu64 ", L%i, LL%i, MID%i", read_in - strbuf.size(), next.cs_id, next.timestamp, next.real_len, next.len_left, next.msg_stream_id); return 0; break; // happens when connection breaks unexpectedly case 1: // set chunk size RTMPStream::chunk_rec_max = ntohl(*(int *)next.data.c_str()); - DETAIL_MED("CTRL: Set chunk size: %" PRIu64, RTMPStream::chunk_rec_max); + DETAIL_MED("CTRL: Set chunk size: %zu", RTMPStream::chunk_rec_max); break; case 2: // abort message - we ignore this one DETAIL_MED("CTRL: Abort message: %" PRIu32, Bit::btohl(next.data.data())); @@ -85,7 +85,7 @@ bool AnalyserRTMP::parsePacket(){ break; case 3: // ack RTMPStream::snd_window_at = Bit::btohl(next.data.data()); - DETAIL_MED("CTRL: Acknowledgement: %" PRIu64, RTMPStream::snd_window_at); + DETAIL_MED("CTRL: Acknowledgement: %zu", RTMPStream::snd_window_at); break; case 4:{ int16_t ucmtype = Bit::btohs(next.data.data()); @@ -124,12 +124,12 @@ bool AnalyserRTMP::parsePacket(){ case 5: // window size of other end RTMPStream::rec_window_size = Bit::btohl(next.data.data()); RTMPStream::rec_window_at = RTMPStream::rec_cnt; - DETAIL_MED("CTRL: Window size: %" PRIu64, RTMPStream::rec_window_size); + DETAIL_MED("CTRL: Window size: %zu", RTMPStream::rec_window_size); break; case 6: RTMPStream::snd_window_size = Bit::btohl(next.data.data()); // 4 bytes window size, 1 byte limit type (ignored) - DETAIL_MED("CTRL: Set peer bandwidth: %" PRIu64, RTMPStream::snd_window_size); + DETAIL_MED("CTRL: Set peer bandwidth: %zu", RTMPStream::snd_window_size); break; case 8: case 9: diff --git a/src/controller/controller_statistics.cpp b/src/controller/controller_statistics.cpp index 0ab6fcf6..c5b7f643 100644 --- a/src/controller/controller_statistics.cpp +++ b/src/controller/controller_statistics.cpp @@ -670,7 +670,7 @@ void Controller::statSession::update(uint64_t index, Comms::Statistics &statComm uint64_t currPktLost = getPktLost(); uint64_t currPktRetrans = getPktRetransmit(); if (currUp - prevUp < 0 || currDown - prevDown < 0){ - INFO_MSG("Negative data usage! %lldu/%lldd (u%lld->%lld) in %s over %s, #%lu", currUp - prevUp, + INFO_MSG("Negative data usage! %lldu/%lldd (u%lld->%lld) in %s over %s, #%" PRIu64, currUp - prevUp, currDown - prevDown, prevUp, currUp, myStream.c_str(), myConnector.c_str(), index); }else{ if (!noBWCount){ diff --git a/src/input/input.cpp b/src/input/input.cpp index 84831421..886af766 100644 --- a/src/input/input.cpp +++ b/src/input/input.cpp @@ -529,7 +529,7 @@ namespace Mist{ if (M && M.getVod()){ meta.removeEmptyTracks(); parseHeader(); - INFO_MSG("Header parsed, %lu tracks", M.getValidTracks().size()); + INFO_MSG("Header parsed, %zu tracks", M.getValidTracks().size()); } if (!streamName.size()){ @@ -1121,7 +1121,7 @@ namespace Mist{ WARN_MSG("No pages for track %zu found", *it); continue; } - MEDIUM_MSG("Track %zu (%s) split into %zu pages", *it, M.getCodec(*it).c_str(), tPages.getEndPos()); + MEDIUM_MSG("Track %zu (%s) split into %" PRIu64 " pages", *it, M.getCodec(*it).c_str(), tPages.getEndPos()); for (size_t j = tPages.getDeleted(); j < tPages.getEndPos(); j++){ size_t pageNumber = tPages.getInt("firstkey", j); size_t pageKeys = tPages.getInt("keycount", j); diff --git a/src/input/input_buffer.cpp b/src/input/input_buffer.cpp index abbd51aa..c3cf51e2 100644 --- a/src/input/input_buffer.cpp +++ b/src/input/input_buffer.cpp @@ -499,7 +499,7 @@ namespace Mist{ std::set validTracks = M.getValidTracks(); if (validTracks != prevValidTracks){ - MEDIUM_MSG("Valid tracks count changed from %lu to %lu", prevValidTracks.size(), validTracks.size()); + MEDIUM_MSG("Valid tracks count changed from %zu to %zu", prevValidTracks.size(), validTracks.size()); prevValidTracks = validTracks; if (Triggers::shouldTrigger("LIVE_TRACK_LIST")){ JSON::Value triggerPayload; @@ -566,7 +566,7 @@ namespace Mist{ if (tmpNum < meta.biggestFragment() / 2){tmpNum = meta.biggestFragment() / 2;} segmentSize = meta.getMinimumFragmentDuration(); if (segmentSize != tmpNum){ - INFO_MSG("Setting segmentSize from %" PRIu64 " to new value of %" PRIu64, segmentSize, tmpNum); + INFO_MSG("Setting segmentSize from %zu to new value of %" PRIu64, segmentSize, tmpNum); segmentSize = tmpNum; meta.setMinimumFragmentDuration(segmentSize); } diff --git a/src/input/input_hls.cpp b/src/input/input_hls.cpp index f5d01a88..8faad7d1 100644 --- a/src/input/input_hls.cpp +++ b/src/input/input_hls.cpp @@ -809,7 +809,7 @@ namespace Mist{ tsStream.getEarliestPacket(thisPacket); tid = getOriginalTrackId(currentPlaylist, thisPacket.getTrackId()); if (!tid){ - INFO_MSG("Track %" PRIu64 " on PLS %" PRIu64 " -> %" PRIu32, thisPacket.getTrackId(), currentPlaylist, tid); + INFO_MSG("Track %zu on PLS %" PRIu64 " -> %" PRIu32, thisPacket.getTrackId(), currentPlaylist, tid); continue; } }else{ @@ -1243,7 +1243,7 @@ namespace Mist{ pListIt != listEntries.end(); pListIt++){ segCount += pListIt->second.size(); if (pListIt->second.size()){ - INSANE_MSG("Playlist %u contains %lu segments, with the earliest segment starting @%zu ms", pListIt->first, pListIt->second.size(), firstTimeStamp); + INSANE_MSG("Playlist %u contains %zu segments, with the earliest segment starting @%" PRIu64 " ms", pListIt->first, pListIt->second.size(), firstTimeStamp); if (pListIt->second.front().timestamp < firstTimeStamp || tmpId < 0){ firstTimeStamp = pListIt->second.front().timestamp; tmpId = pListIt->first; diff --git a/src/input/input_mp3.cpp b/src/input/input_mp3.cpp index 83bc7f37..cbe75a5a 100644 --- a/src/input/input_mp3.cpp +++ b/src/input/input_mp3.cpp @@ -63,7 +63,7 @@ namespace Mist{ size_t id3size = (((int)header[6] & 0x7F) << 21) | (((int)header[7] & 0x7F) << 14) | (((int)header[8] & 0x7F) << 7) | ((header[9] & 0x7F) + 10 + ((header[5] & 0x10) ? 10 : 0)); - INFO_MSG("id3 size: %lu bytes", id3size); + INFO_MSG("id3 size: %zu bytes", id3size); fseek(inFile, id3size, SEEK_SET); }else{ fseek(inFile, 0, SEEK_SET); diff --git a/src/input/input_mp4.cpp b/src/input/input_mp4.cpp index b27a5943..45dcd19a 100644 --- a/src/input/input_mp4.cpp +++ b/src/input/input_mp4.cpp @@ -484,7 +484,7 @@ namespace Mist{ malSize = curPart.size; } if (fread(data, curPart.size, 1, inFile) != 1){ - FAIL_MSG("read unsuccessful at %" PRIu64, ftell(inFile)); + FAIL_MSG("read unsuccessful at %ld", ftell(inFile)); thisPacket.null(); return; } diff --git a/src/input/input_ogg.cpp b/src/input/input_ogg.cpp index e8a04aa8..7e262138 100644 --- a/src/input/input_ogg.cpp +++ b/src/input/input_ogg.cpp @@ -430,7 +430,7 @@ namespace Mist{ } tmpPos.segmentNo = backChrs - (loc - buffer); tmpPos.bytepos -= tmpPos.segmentNo; - INFO_MSG("Track %zu, segment %zu found at bytepos %" PRIu64, it->first, tmpPos.segmentNo, + INFO_MSG("Track %zu, segment %" PRIu64 " found at bytepos %" PRIu64, it->first, tmpPos.segmentNo, tmpPos.bytepos); currentPositions.insert(tmpPos); diff --git a/src/input/input_rtsp.cpp b/src/input/input_rtsp.cpp index ce48c0ef..fef613bb 100644 --- a/src/input/input_rtsp.cpp +++ b/src/input/input_rtsp.cpp @@ -157,7 +157,7 @@ namespace Mist{ } if (sdpState.tracks.size()){ bool atLeastOne = false; - for (std::map::iterator it = sdpState.tracks.begin(); + for (std::map::iterator it = sdpState.tracks.begin(); it != sdpState.tracks.end(); ++it){ transportSet = false; extraHeaders.clear(); @@ -358,7 +358,7 @@ namespace Mist{ bool InputRTSP::handleUDP(){ if (TCPmode){return false;} bool r = false; - for (std::map::iterator it = sdpState.tracks.begin(); + for (std::map::iterator it = sdpState.tracks.begin(); it != sdpState.tracks.end(); ++it){ Socket::UDPConnection &s = it->second.data; it->second.sorter.setCallback(it->first, insertRTP); diff --git a/src/input/input_ts.cpp b/src/input/input_ts.cpp index f29582df..6165e333 100644 --- a/src/input/input_ts.cpp +++ b/src/input/input_ts.cpp @@ -587,7 +587,7 @@ namespace Mist{ 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 %" PRIu64 " timed out %" PRIu64 + WARN_MSG("Thread for track %zu timed out %" PRIu64 " seconds ago without a clean shutdown.", *it, Util::bootSecs() - threadTimer[*it]); threadTimer.erase(*it); diff --git a/src/io.cpp b/src/io.cpp index bb9f9a11..7bd5c4d7 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -220,7 +220,7 @@ namespace Mist{ uint64_t pageSize = tPages.getInt("size", pageIdx); // Do nothing when there is not enough free space on the page to add the packet. if (pageSize - pageOffset < packDataLen){ - FAIL_MSG("Track %" PRIu32 "p%" PRIu32 " : Pack %" PRIu64 "ms of %" PRIu64 "b exceeds size %" PRIu64 " @ bpos %" PRIu64, + FAIL_MSG("Track %" PRIu32 "p%" PRIu32 " : Pack %" PRIu64 "ms of %zub exceeds size %" PRIu64 " @ bpos %" PRIu64, packTrack, currPagNum, packTime, packDataLen, pageSize, pageOffset); return; } @@ -386,7 +386,7 @@ namespace Mist{ } // Create the book keeping data for the new page nextPageNum = tPages.getInt("firstkey", endPage - 1) + tPages.getInt("keycount", endPage - 1); - HIGH_MSG("Live page transition from %" PRIu32 ":%zu to %" PRIu32 ":%" PRIu32, packTrack, + HIGH_MSG("Live page transition from %" PRIu32 ":%" PRIu64 " to %" PRIu32 ":%" PRIu32, packTrack, tPages.getInt("firstkey", endPage - 1), packTrack, nextPageNum); tPages.setInt("firstkey", nextPageNum, endPage); tPages.setInt("firsttime", packTime, endPage); diff --git a/src/output/output.cpp b/src/output/output.cpp index b2cbb6d3..dd8b0ef3 100644 --- a/src/output/output.cpp +++ b/src/output/output.cpp @@ -857,7 +857,7 @@ namespace Mist{ } if (mainTrack == ti->first){continue;}// skip self if (!M.trackValid(ti->first)){ - HIGH_MSG("Skipping track %lu, not in tracks", ti->first); + HIGH_MSG("Skipping track %zu, not in tracks", ti->first); continue; }// ignore missing tracks if (M.getLastms(ti->first) < seekPos + needsLookAhead + extraKeepAway + M.getMinKeepAway(ti->first)){ @@ -865,7 +865,7 @@ namespace Mist{ break; } if (meta.getLastms(ti->first) == M.getFirstms(ti->first)){ - HIGH_MSG("Skipping track %lu, last equals first", ti->first); + HIGH_MSG("Skipping track %zu, last equals first", ti->first); continue; }// ignore point-tracks if (meta.getLastms(ti->first) < seekPos){ @@ -881,7 +881,7 @@ namespace Mist{ /*LTS-START*/ if (isRecordingToFile){ if (M.getLive()){ - MEDIUM_MSG("Stream currently contains data from %lu ms to %lu ms", startTime(), endTime()); + MEDIUM_MSG("Stream currently contains data from %" PRIu64 " ms to %" PRIu64 " ms", startTime(), endTime()); } // Overwrite recstart/recstop with recstartunix/recstopunix if set if (M.getLive() && @@ -952,7 +952,7 @@ namespace Mist{ INFO_MSG("Recording will start at timestamp %llu ms", atoll(targetParams["recstart"].c_str())); } else{ - INFO_MSG("Recording will start at timestamp %lu ms", endTime()); + INFO_MSG("Recording will start at timestamp %" PRIu64 " ms", endTime()); } if (targetParams.count("recstop")){ INFO_MSG("Recording will stop at timestamp %llu ms", atoll(targetParams["recstop"].c_str())); @@ -988,12 +988,12 @@ namespace Mist{ int64_t origStartUnix = startUnix; startUnix += Util::epoch(); if (startUnix < unixStreamBegin){ - INFO_MSG("Waiting for stream to reach playback starting point. Current last ms is '%lu'", streamAvail); + INFO_MSG("Waiting for stream to reach playback starting point. Current last ms is '%" PRIu64 "'", streamAvail); while (startUnix < Util::epoch() - (endTime() / 1000) && keepGoing()){ Util::wait(1000); stats(); startUnix = origStartUnix + Util::epoch(); - HIGH_MSG("Waiting for stream to reach playback starting point. Current last ms is '%lu'", streamAvail); + HIGH_MSG("Waiting for stream to reach playback starting point. Current last ms is '%" PRIu64 "'", streamAvail); } } } @@ -1034,11 +1034,11 @@ namespace Mist{ } int64_t streamAvail = M.getLastms(mainTrack); int64_t lastUpdated = Util::getMS(); - INFO_MSG("Waiting for stream to reach playback starting point. Current last ms is '%lu'", streamAvail); + INFO_MSG("Waiting for stream to reach playback starting point. Current last ms is '%" PRIu64 "'", streamAvail); while (Util::getMS() - lastUpdated < 5000 && startRec > streamAvail && keepGoing()){ Util::sleep(500); if (M.getLastms(mainTrack) > streamAvail){ - HIGH_MSG("Waiting for stream to reach playback starting point. Current last ms is '%lu'", streamAvail); + HIGH_MSG("Waiting for stream to reach playback starting point. Current last ms is '%" PRIu64 "'", streamAvail); stats(); streamAvail = M.getLastms(mainTrack); lastUpdated = Util::getMS(); @@ -1064,7 +1064,7 @@ namespace Mist{ MEDIUM_MSG("Initial seek to %" PRIu64 "ms", seekPos); seek(seekPos); }else{ - ERROR_MSG("Aborting seek to %" PRIu64 " since stream only has available from %lu ms to %lu ms", seekPos, startTime(), endTime()); + ERROR_MSG("Aborting seek to %" PRIu64 " since stream only has available from %" PRIu64 " ms to %" PRIu64 " ms", seekPos, startTime(), endTime()); } } @@ -1116,7 +1116,7 @@ namespace Mist{ } } if (realTime != newSpeed){ - HIGH_MSG("Changing playback speed from %" PRIu64 " to %" PRIu64 "(%" PRIu64 " ms LA, %" PRIu64 " ms mKA, %lu eKA)", realTime, newSpeed, needsLookAhead, mKa, extraKeepAway); + HIGH_MSG("Changing playback speed from %" PRIu64 " to %" PRIu64 "(%" PRIu64 " ms LA, %" PRIu64 " ms mKA, %" PRIu64 " eKA)", realTime, newSpeed, needsLookAhead, mKa, extraKeepAway); firstTime = Util::bootMS() - (cTime * newSpeed / 1000); realTime = newSpeed; } @@ -1144,15 +1144,15 @@ namespace Mist{ } if (mainTrack == ti->first){continue;}// skip self if (meta.getLastms(ti->first) == meta.getFirstms(ti->first)){ - HIGH_MSG("Skipping track %lu, last equals first", ti->first); + HIGH_MSG("Skipping track %zu, last equals first", ti->first); continue; }// ignore point-tracks - HIGH_MSG("Track %lu is good", ti->first); + HIGH_MSG("Track %zu is good", ti->first); } // if yes, seek here if (good){ HIGH_MSG("Skipping forward %" PRIu64 "ms (%" PRIu64 " ms LA, %" PRIu64 - " ms mKA, %lu eKA, > %" PRIu32 "ms, mSa %" PRIu64 " ms)", + " ms mKA, %" PRIu64 " eKA, > %" PRIu32 "ms, mSa %" PRIu64 " ms)", seekPos - cTime, needsLookAhead, mKa, extraKeepAway, seekCount * 100, maxSkipAhead); if (seekCount < 20){++seekCount;} seek(seekPos); @@ -1316,7 +1316,7 @@ namespace Mist{ // delay the stream until metadata has caught up, if needed if (needsLookAhead && M.getLive()){ // we sleep in 20ms increments, or less if the lookahead time itself is less - uint32_t sleepTime = std::min(20ul, needsLookAhead); + uint32_t sleepTime = std::min((uint64_t)20, needsLookAhead); // wait at most double the look ahead time, plus ten seconds uint64_t timeoutTries = (needsLookAhead / sleepTime) * 2 + (10000 / sleepTime); uint64_t needsTime = thisTime + needsLookAhead; @@ -1346,7 +1346,7 @@ namespace Mist{ meta.reloadReplacedPagesIfNeeded(); } if (!timeoutTries){ - WARN_MSG("Waiting for lookahead (%zums in %zu tracks) timed out - resetting lookahead!", needsLookAhead, userSelect.size()); + WARN_MSG("Waiting for lookahead (%" PRIu64 "ms in %zu tracks) timed out - resetting lookahead!", needsLookAhead, userSelect.size()); needsLookAhead = 0; } } @@ -1452,8 +1452,8 @@ namespace Mist{ // depending on whether this is probably bad and the current debug level, print a message size_t printLevel = (probablyBad ? DLVL_WARN : DLVL_INFO); const Comms::Users &usr = userSelect.at(trackId); - DEBUG_MSG(printLevel, "Dropping %s (%s) track %zu@k%zu (nextP=%zu, lastP=%zu): %s", - streamName.c_str(), meta.getCodec(trackId).c_str(), trackId, usr.getKeyNum() + 1, + DEBUG_MSG(printLevel, "Dropping %s track %zu@k%zu (nextP=%" PRIu64 ", lastP=%" PRIu64 "): %s", + meta.getCodec(trackId).c_str(), trackId, usr.getKeyNum() + 1, pageNumForKey(trackId, usr.getKeyNum() + 1), pageNumMax(trackId), reason.c_str()); // now actually drop the track from the buffer buffer.dropTrack(trackId); @@ -1651,7 +1651,7 @@ namespace Mist{ } //every ~16 seconds, reconnect to metadata if (emptyCount % 1600 == 0){ - INFO_MSG("Reconnecting to input; track %" PRIu64 " key %" PRIu32 " is on page %" PRIu32 " and we're currently serving %" PRIu32 " from %" PRIu32, nxt.tid, thisKey+1, nextKeyPage, thisKey, currentPage[nxt.tid]); + INFO_MSG("Reconnecting to input; track %zu key %" PRIu32 " is on page %" PRIu32 " and we're currently serving %" PRIu32 " from %" PRIu32, nxt.tid, thisKey+1, nextKeyPage, thisKey, currentPage[nxt.tid]); reconnect(); if (!meta){ onFail("Could not connect to stream data", true); @@ -1768,7 +1768,7 @@ namespace Mist{ lastStats = now; - VERYHIGH_MSG("Writing stats: %s, %s, %u, %lu, %lu", getConnectedHost().c_str(), streamName.c_str(), + VERYHIGH_MSG("Writing stats: %s, %s, %u, %" PRIu64 ", %" PRIu64, getConnectedHost().c_str(), streamName.c_str(), crc & 0xFFFFFFFFu, myConn.dataUp(), myConn.dataDown()); /*LTS-START*/ if (statComm.getStatus() & COMM_STATUS_REQDISCONNECT){ diff --git a/src/output/output_ebml.cpp b/src/output/output_ebml.cpp index e69cf876..59aec749 100644 --- a/src/output/output_ebml.cpp +++ b/src/output/output_ebml.cpp @@ -348,7 +348,7 @@ namespace Mist{ EBML::sendElemHead(myConn, EBML::EID_CUES, cuesSize); uint64_t tmpsegSize = infoSize + tracksSize + seekheadSize + cuesSize + EBML::sizeElemHead(EBML::EID_CUES, cuesSize); - for (std::map::iterator it = clusterSizes.begin(); it != clusterSizes.end(); ++it){ + for (std::map::iterator it = clusterSizes.begin(); it != clusterSizes.end(); ++it){ EBML::sendElemCuePoint(myConn, it->first, idx + 1, tmpsegSize, 0); tmpsegSize += it->second; } @@ -358,8 +358,8 @@ namespace Mist{ /// Seeks to the given byte position by doing a regular seek and remembering the byte offset from /// that point - void OutEBML::byteSeek(uint64_t startPos){ - INFO_MSG("Seeking to %" PRIu64 " bytes", startPos); + void OutEBML::byteSeek(size_t startPos){ + INFO_MSG("Seeking to %zu bytes", startPos); sentHeader = false; newClusterTime = 0; if (startPos == 0){ @@ -377,10 +377,10 @@ namespace Mist{ } startPos -= headerSize; sentHeader = true; // skip the header - for (std::map::iterator it = clusterSizes.begin(); it != clusterSizes.end(); ++it){ - VERYHIGH_MSG("Cluster %" PRIu64 " (%" PRIu64 " bytes) -> %" PRIu64 " to go", it->first, it->second, startPos); + for (std::map::iterator it = clusterSizes.begin(); it != clusterSizes.end(); ++it){ + VERYHIGH_MSG("Cluster %zu (%zu bytes) -> %zu to go", it->first, it->second, startPos); if (startPos < it->second){ - HIGH_MSG("Seek to fragment at %" PRIu64 " ms", it->first); + HIGH_MSG("Seek to fragment at %zu ms", it->first); myConn.skipBytes(startPos); seek(it->first); newClusterTime = it->first; @@ -413,8 +413,8 @@ namespace Mist{ totalSize = EBML::sizeElemEBML(doctype) + EBML::sizeElemHead(EBML::EID_SEGMENT, segmentSize) + segmentSize; } - size_t byteEnd = totalSize - 1; - size_t byteStart = 0; + uint64_t byteEnd = totalSize - 1; + uint64_t byteStart = 0; if (!M.getLive() && req.GetHeader("Range") != ""){ //Range request if (parseRange(req.GetHeader("Range"), byteStart, byteEnd)){ @@ -521,7 +521,7 @@ namespace Mist{ segmentSize = infoSize + tracksSize + seekheadSize + cuesSize + EBML::sizeElemHead(EBML::EID_CUES, cuesSize); uint32_t cuesInside = 0; - for (std::map::iterator it = clusterSizes.begin(); it != clusterSizes.end(); ++it){ + for (std::map::iterator it = clusterSizes.begin(); it != clusterSizes.end(); ++it){ cuesInside += EBML::sizeElemCuePoint(it->first, idx + 1, segmentSize, 0); segmentSize += it->second; } diff --git a/src/output/output_ebml.h b/src/output/output_ebml.h index bc121263..4889f403 100644 --- a/src/output/output_ebml.h +++ b/src/output/output_ebml.h @@ -24,7 +24,7 @@ namespace Mist{ uint64_t newClusterTime; // VoD-only void calcVodSizes(); - size_t segmentSize; // size of complete segment contents (excl. header) + uint64_t segmentSize; // size of complete segment contents (excl. header) size_t tracksSize; // size of Tracks (incl. header) size_t infoSize; // size of Info (incl. header) size_t cuesSize; // size of Cues (excl. header) diff --git a/src/output/output_mp4.cpp b/src/output/output_mp4.cpp index 5a15d062..d5695c1e 100644 --- a/src/output/output_mp4.cpp +++ b/src/output/output_mp4.cpp @@ -836,7 +836,7 @@ namespace Mist{ segfaults. */ if (!thisPacket.getData()) { - FAIL_MSG("Current packet has no data, lookahead: %lu.", needsLookAhead); + FAIL_MSG("Current packet has no data, lookahead: %" PRIu64, needsLookAhead); return; } @@ -1185,7 +1185,7 @@ namespace Mist{ H.SendResponse("500", "Error generating MP4 header", myConn); return; } - INFO_MSG("Have %zu bytes, sending %zu bytes", headerData.size(), std::min(headerSize, byteEnd) - byteStart); + INFO_MSG("Have %zu bytes, sending %" PRIu64 " bytes", headerData.size(), std::min(headerSize, byteEnd) - byteStart); H.Chunkify(headerData + byteStart, std::min(headerSize, byteEnd) - byteStart, myConn); leftOver -= std::min(headerSize, byteEnd) - byteStart; } diff --git a/src/output/output_ogg.cpp b/src/output/output_ogg.cpp index 78d4737c..15325b95 100644 --- a/src/output/output_ogg.cpp +++ b/src/output/output_ogg.cpp @@ -66,7 +66,7 @@ namespace Mist{ size_t index = 0; if (initData[0] == 0x02){//"special" case, requires interpretation similar to table if (initData.size() < 7){ - FAIL_MSG("initData size too tiny (size: %lu)", initData.size()); + FAIL_MSG("initData size too tiny (size: %zu)", initData.size()); return false; } size_t len1 = 0; @@ -94,7 +94,7 @@ namespace Mist{ output.push_back(initData.substr(index)); }else{ if (initData.size() < 7){ - FAIL_MSG("initData size too tiny (size: %lu)", initData.size()); + FAIL_MSG("initData size too tiny (size: %zu)", initData.size()); return false; } unsigned int len = 0; diff --git a/src/output/output_rtmp.cpp b/src/output/output_rtmp.cpp index d295d5a9..f63fce72 100644 --- a/src/output/output_rtmp.cpp +++ b/src/output/output_rtmp.cpp @@ -1329,7 +1329,7 @@ namespace Mist{ break; // happens when connection breaks unexpectedly case 1: // set chunk size RTMPStream::chunk_rec_max = Bit::btohl(next.data.data()); - MEDIUM_MSG("CTRL: Set chunk size: %" PRIu64, RTMPStream::chunk_rec_max); + MEDIUM_MSG("CTRL: Set chunk size: %zu", RTMPStream::chunk_rec_max); break; case 2: // abort message - we ignore this one MEDIUM_MSG("CTRL: Abort message"); @@ -1438,7 +1438,7 @@ namespace Mist{ tagTime -= (tagTime - ltt) - 1; } } - uint64_t idx = reTrackToID[reTrack]; + size_t idx = reTrackToID[reTrack]; if (idx != INVALID_TRACK_ID && !userSelect.count(idx)){ userSelect[idx].reload(streamName, idx, COMM_STATUS_ACTIVE | COMM_STATUS_SOURCE); } diff --git a/src/output/output_rtsp.cpp b/src/output/output_rtsp.cpp index 8e09c10a..c4b235cc 100644 --- a/src/output/output_rtsp.cpp +++ b/src/output/output_rtsp.cpp @@ -506,7 +506,7 @@ namespace Mist{ /// Reads and handles RTP packets over UDP, if needed void OutRTSP::handleUDP(){ if (!isPushing()){return;} - for (std::map::iterator it = sdpState.tracks.begin(); + for (std::map::iterator it = sdpState.tracks.begin(); it != sdpState.tracks.end(); ++it){ Socket::UDPConnection &s = it->second.data; it->second.sorter.setCallback(it->first, insertRTP); diff --git a/src/output/output_ts_base.cpp b/src/output/output_ts_base.cpp index 90a5be58..42843c45 100644 --- a/src/output/output_ts_base.cpp +++ b/src/output/output_ts_base.cpp @@ -134,7 +134,7 @@ namespace Mist{ while (i + 4 < (unsigned int)dataLen){ ThisNaluSize = Bit::btohl(dataPointer + i); if (ThisNaluSize + i + 4 > dataLen){ - WARN_MSG("Too big NALU detected (%" PRIu32 " > %" PRIu64 ") - skipping!", + WARN_MSG("Too big NALU detected (%" PRIu32 " > %zu) - skipping!", ThisNaluSize + i + 4, dataLen); break; } diff --git a/src/process/process_livepeer.cpp b/src/process/process_livepeer.cpp index 87121a04..85ad12fc 100644 --- a/src/process/process_livepeer.cpp +++ b/src/process/process_livepeer.cpp @@ -230,7 +230,7 @@ namespace Mist{ trackId = (S.ID << 16) + thisPacket.getTrackId(); size_t idx = M.trackIDToIndex(trackId, getpid()); if (idx == INVALID_TRACK_ID || !M.getCodec(idx).size()){ - INFO_MSG("Initializing track %zi as %" PRIu64 " for playlist %" PRIu64, thisPacket.getTrackId(), trackId, S.ID); + INFO_MSG("Initializing track %zi as %" PRIu64 " for playlist %zu", thisPacket.getTrackId(), trackId, S.ID); S.S.initializeMetadata(meta, thisPacket.getTrackId(), trackId); } } diff --git a/src/utils/util_nuke.cpp b/src/utils/util_nuke.cpp index 8f984864..fa8a1c86 100644 --- a/src/utils/util_nuke.cpp +++ b/src/utils/util_nuke.cpp @@ -99,7 +99,7 @@ int main(int argc, char **argv){ for (uint64_t j = pages.getDeleted(); j < pages.getEndPos(); j++){ char thisPageName[NAME_BUFFER_SIZE]; snprintf(thisPageName, NAME_BUFFER_SIZE, SHM_TRACK_DATA, - Util::streamName, i, pages.getInt("firstkey", j)); + Util::streamName, i, (uint32_t)pages.getInt("firstkey", j)); IPC::sharedPage p(thisPageName, 0); p.master = true; }