[vlc-commits] [Git][videolan/vlc][3.0.x] 4 commits: avi: fix format string

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Mar 12 11:55:47 UTC 2025



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
141d8795 by Rémi Denis-Courmont at 2025-03-12T11:24:32+00:00
avi: fix format string

(cherry picked from commit 4382fe0f8461b611d35aaec3dc73cace1a1a32f6)

- - - - -
458b19af by Alexandre Janniaux at 2025-03-12T11:24:32+00:00
aribcam: use %zu formatter for size_t

Fix warnings when size_t is not the same size as a long unsigned int.

(cherry picked from commit 20b485cd901afb5b04e7dd9b74a9d1d97a0ceb85)

- - - - -
d8715e1a by Marvin Scholz at 2025-03-12T11:24:32+00:00
demux: adaptive: use correct format specifier

(cherry picked from commit 311e0303c54b7a7afe2a2b8daeb05c2d03a79ed6)

- - - - -
6d7029aa by Steve Lhomme at 2025-03-12T11:24:32+00:00
adaptive: fix debug string formatting

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

(cherry picked from commit 88a93fbcb93eea470ca16c28d3c24a9ce9520f16) (edited)
edited:
- HTTPConnectionManager.cpp doesn't have some logs in 3.0
- 3.0 has some mutex unlock after some logs

- - - - -


7 changed files:

- modules/demux/adaptive/PlaylistManager.cpp
- modules/demux/adaptive/Streams.cpp
- modules/demux/adaptive/http/HTTPConnectionManager.cpp
- modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp
- modules/demux/adaptive/logic/PredictiveAdaptationLogic.cpp
- modules/demux/avi/libavi.c
- modules/stream_filter/aribcam.c


Changes:

=====================================
modules/demux/adaptive/PlaylistManager.cpp
=====================================
@@ -644,7 +644,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 currentTimes = getTimes();
     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));
 
@@ -846,7 +846,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/Streams.cpp
=====================================
@@ -462,7 +462,7 @@ AbstractStream::BufferingStatus AbstractStream::doBufferize(Times deadline,
             }
             else
             {
-                msg_Dbg(p_realdemux, "Waiting sync reference for seq %ld", currentSequence);
+                msg_Dbg(p_realdemux, "Waiting sync reference for seq %" PRIu64, currentSequence);
                 vlc_mutex_unlock(&lock);
                 return BufferingStatus::Suspended;
             }


=====================================
modules/demux/adaptive/http/HTTPConnectionManager.cpp
=====================================
@@ -176,7 +176,7 @@ AbstractChunkSource *HTTPConnectionManager::makeSource(const std::string &url,
                 {
                     cache.remove(s);
                     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;
                 }
@@ -216,13 +216,13 @@ void HTTPConnectionManager::recycleSource(AbstractChunkSource *source)
             HTTPChunkBufferedSource *purged = cache.back();
             cache.pop_back();
             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
=====================================
@@ -153,7 +153,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;
@@ -220,7 +220,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)));
             vlc_mutex_unlock(&lock);
         }
         break;


=====================================
modules/demux/adaptive/logic/PredictiveAdaptationLogic.cpp
=====================================
@@ -136,7 +136,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);
         } );
 
@@ -191,7 +191,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)));
             vlc_mutex_unlock(&lock);
         }
         break;


=====================================
modules/demux/avi/libavi.c
=====================================
@@ -87,8 +87,8 @@ static int AVI_ChunkReadCommon( stream_t *s, avi_chunk_t *p_chk,
 
     if( p_father && AVI_ChunkEnd( p_chk ) > AVI_ChunkEnd( p_father ) )
     {
-        msg_Warn( s, "chunk %4.4s does not fit into parent %ld",
-                     (char*)&p_chk->common.i_chunk_fourcc, AVI_ChunkEnd( p_father ) );
+        msg_Warn( s, "chunk %4.4s does not fit into parent %"PRIu64,
+                  (char*)&p_chk->common.i_chunk_fourcc, AVI_ChunkEnd( p_father ) );
 
         /* How hard is to produce files with the correct declared size ? */
         if( p_father->common.i_chunk_fourcc != AVIFOURCC_RIFF ||


=====================================
modules/stream_filter/aribcam.c
=====================================
@@ -197,7 +197,7 @@ static ssize_t Read( stream_t *p_stream, void *p_buf, size_t i_toread )
         else
         {
             if ( i_srcread < 0 )
-                msg_Err( p_stream, "Can't read %lu bytes from source stream: %d", i_toread, i_srcread );
+                msg_Err( p_stream, "Can't read %zu bytes from source stream: %d", i_toread, i_srcread );
             return 0;
         }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ce971ea70a7dad794490ed39ceea28498e706516...6d7029aa047b318ad77a604c68c61b3e84522502

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ce971ea70a7dad794490ed39ceea28498e706516...6d7029aa047b318ad77a604c68c61b3e84522502
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