Fixed all ARM-related issues/warnings/etc

This commit is contained in:
Thulinma 2021-05-21 17:54:24 +02:00
parent dae32ede11
commit 6733bf2a20
44 changed files with 123 additions and 120 deletions

View file

@ -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){

View file

@ -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<uint64_t, uint64_t>::iterator it = clusterSizes.begin(); it != clusterSizes.end(); ++it){
for (std::map<size_t, size_t>::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<uint64_t, uint64_t>::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<size_t, size_t>::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<uint64_t, uint64_t>::iterator it = clusterSizes.begin(); it != clusterSizes.end(); ++it){
for (std::map<size_t, size_t>::iterator it = clusterSizes.begin(); it != clusterSizes.end(); ++it){
cuesInside += EBML::sizeElemCuePoint(it->first, idx + 1, segmentSize, 0);
segmentSize += it->second;
}

View file

@ -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)

View file

@ -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;
}

View file

@ -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;

View file

@ -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);
}

View file

@ -506,7 +506,7 @@ namespace Mist{
/// Reads and handles RTP packets over UDP, if needed
void OutRTSP::handleUDP(){
if (!isPushing()){return;}
for (std::map<size_t, SDP::Track>::iterator it = sdpState.tracks.begin();
for (std::map<uint64_t, SDP::Track>::iterator it = sdpState.tracks.begin();
it != sdpState.tracks.end(); ++it){
Socket::UDPConnection &s = it->second.data;
it->second.sorter.setCallback(it->first, insertRTP);

View file

@ -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;
}