Skip to content
Snippets Groups Projects
Commit 88a93fbc authored by Steve Lhomme's avatar Steve Lhomme
Browse files

adaptive: fix debug string formatting

These debug messages can be enabled via defines in Debug.hpp.
parent 4016a7f6
No related branches found
No related tags found
1 merge request!4509adaptive: fix debug string formatting
Pipeline #404891 passed with stage
in 12 minutes and 2 seconds
......@@ -643,7 +643,7 @@ int PlaylistManager::doControl(int i_query, va_list args)
bool accurate = va_arg(args, int);
vlc_tick_t seekTime = cached.playlistStart + cached.playlistLength * pos;
SeekDebug(msg_Dbg(p_demux, "Seek %f to %ld plstart %ld duration %ld",
SeekDebug(msg_Dbg(p_demux, "Seek %f to %" PRId64 " plstart %" PRId64 " duration %" PRId64,
pos, seekTime, cached.playlistEnd, cached.playlistLength));
if(!setPosition(seekTime, pos, accurate))
......@@ -800,8 +800,8 @@ void PlaylistManager::updateControlsPosition()
Times startTimes = getTimes(true);
cached.b_live = playlist->isLive();
SeekDebug(msg_Dbg(p_demux, "playlist Start/End %ld/%ld len %ld"
"rap pl/demux (%ld/%ld)",
SeekDebug(msg_Dbg(p_demux, "playlist Start/End %" PRId64 "/%" PRId64 " len %" PRId64
"rap pl/demux (%" PRId64 "/%" PRId64 ")",
cached.playlistStart, cached.playlistEnd, cached.playlistEnd,
startTimes.segment.media, startTimes.segment.demux));
......@@ -849,7 +849,7 @@ void PlaylistManager::updateControlsPosition()
}
}
SeekDebug(msg_Dbg(p_demux, "cached.i_time (%ld) cur %ld rap start (pl %ld/dmx %ld) pos %f",
SeekDebug(msg_Dbg(p_demux, "cached.i_time (%" PRId64 ") cur %" PRId64 " rap start (pl %" PRId64 "/dmx %" PRId64 ") pos %f",
cached.i_time, currentTimes.continuous, startTimes.segment.media,
startTimes.segment.demux, cached.f_position));
}
......
......@@ -93,7 +93,7 @@ HTTPConnectionManager::~HTTPConnectionManager ()
cache.pop_back();
assert(cache_total >= purged->contentLength);
cache_total -= purged->contentLength;
CacheDebug(msg_Dbg(p_object, "Cache DEL '%s' usage %u bytes",
CacheDebug(msg_Dbg(p_object, "Cache DEL '%s' usage %zu bytes",
purged->getStorageID().c_str(), cache_total));
deleteSource(purged);
}
......@@ -184,7 +184,7 @@ AbstractChunkSource *HTTPConnectionManager::makeSource(const std::string &url,
cache.remove(s);
assert(cache_total >= s->contentLength);
cache_total -= s->contentLength;
CacheDebug(msg_Dbg(p_object, "Cache GET '%s' usage %u bytes",
CacheDebug(msg_Dbg(p_object, "Cache GET '%s' usage %zu bytes",
storageid.c_str(), cache_total));
return s;
}
......@@ -225,13 +225,13 @@ void HTTPConnectionManager::recycleSource(AbstractChunkSource *source)
cache.pop_back();
assert(cache_total >= purged->contentLength);
cache_total -= purged->contentLength;
CacheDebug(msg_Dbg(p_object, "Cache DEL '%s' usage %u bytes",
CacheDebug(msg_Dbg(p_object, "Cache DEL '%s' usage %zu bytes",
purged->getStorageID().c_str(), cache_total));
deleteSource(purged);
}
cache.push_front(buf);
cache_total += buf->contentLength;
CacheDebug(msg_Dbg(p_object, "Cache PUT '%s' usage %u bytes",
CacheDebug(msg_Dbg(p_object, "Cache PUT '%s' usage %zu bytes",
buf->getStorageID().c_str(), cache_total));
}
else
......
......@@ -150,7 +150,7 @@ BaseRepresentation *NearOptimalAdaptationLogic::getNextRepresentation(BaseAdapta
}
}
BwDebug( msg_Info(p_obj, "buffering level %.2f% rep %ld kBps %zu kBps",
BwDebug( msg_Info(p_obj, "buffering level %.2f%% rep %" PRId64 " kBps %u kBps",
(float) 100 * ctxcopy.buffering_level / ctxcopy.buffering_target, m->getBandwidth()/8000, bps / 8000); );
return m;
......@@ -216,7 +216,7 @@ void NearOptimalAdaptationLogic::trackerEvent(const TrackerEvent &ev)
usedBps -= event.prev->getBandwidth();
if(event.next)
usedBps += event.next->getBandwidth();
BwDebug(msg_Info(p_obj, "New total bandwidth usage %zu kBps", (usedBps / 8000)));
BwDebug(msg_Info(p_obj, "New total bandwidth usage %u kBps", (usedBps / 8000)));
}
break;
......
......@@ -134,7 +134,7 @@ BaseRepresentation *PredictiveAdaptationLogic::getNextRepresentation(BaseAdaptat
BwDebug( for(it=streams.begin(); it != streams.end(); ++it)
{
const PredictiveStats &s = (*it).second;
msg_Info(p_obj, "Stream %s buffering level %.2f%",
msg_Info(p_obj, "Stream %s buffering level %.2f%%",
(*it).first.str().c_str(), (double) s.buffering_level / s.buffering_target);
} );
......@@ -186,7 +186,7 @@ void PredictiveAdaptationLogic::trackerEvent(const TrackerEvent &ev)
if(event.next)
usedBps += event.next->getBandwidth();
BwDebug(msg_Info(p_obj, "New total bandwidth usage %zu KiB/s", (usedBps / 8000)));
BwDebug(msg_Info(p_obj, "New total bandwidth usage %u KiB/s", (usedBps / 8000)));
}
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment