[vlc-commits] [Git][videolan/vlc][master] adaptive: fix debug string formatting

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Nov 11 14:17:04 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
88a93fbc by Steve Lhomme at 2023-11-11T13:33:49+00:00
adaptive: fix debug string formatting

These debug messages can be enabled via defines in Debug.hpp.

- - - - -


4 changed files:

- modules/demux/adaptive/PlaylistManager.cpp
- modules/demux/adaptive/http/HTTPConnectionManager.cpp
- modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp
- modules/demux/adaptive/logic/PredictiveAdaptationLogic.cpp


Changes:

=====================================
modules/demux/adaptive/PlaylistManager.cpp
=====================================
@@ -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));
 }


=====================================
modules/demux/adaptive/http/HTTPConnectionManager.cpp
=====================================
@@ -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


=====================================
modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp
=====================================
@@ -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;
 


=====================================
modules/demux/adaptive/logic/PredictiveAdaptationLogic.cpp
=====================================
@@ -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;
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/88a93fbcb93eea470ca16c28d3c24a9ce9520f16

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/88a93fbcb93eea470ca16c28d3c24a9ce9520f16
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list