[vlc-commits] demux:adaptive: replace hardcoded CLOCK_FREQ multiples by VLC_TICK_FROM_SEC()

Steve Lhomme git at videolan.org
Fri Jul 6 09:20:33 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Jun 11 11:24:49 2018 +0200| [62836de287c6d2e373efa130d719405c17afc0eb] | committer: Steve Lhomme

demux:adaptive: replace hardcoded CLOCK_FREQ multiples by VLC_TICK_FROM_SEC()

Easier to read and more explicit.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=62836de287c6d2e373efa130d719405c17afc0eb
---

 modules/demux/adaptive/PlaylistManager.cpp             | 4 ++--
 modules/demux/adaptive/playlist/BaseRepresentation.cpp | 2 +-
 modules/demux/adaptive/playlist/SegmentInformation.cpp | 2 +-
 modules/demux/adaptive/plumbing/FakeESOut.cpp          | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/demux/adaptive/PlaylistManager.cpp b/modules/demux/adaptive/PlaylistManager.cpp
index d3f642737d..a8b2d7afb8 100644
--- a/modules/demux/adaptive/PlaylistManager.cpp
+++ b/modules/demux/adaptive/PlaylistManager.cpp
@@ -597,7 +597,7 @@ int PlaylistManager::doControl(int i_query, va_list args)
         }
 
         case DEMUX_GET_PTS_DELAY:
-            *va_arg (args, int64_t *) = 1000 * INT64_C(1000);
+            *va_arg (args, int64_t *) = VLC_TICK_FROM_SEC(1);
             break;
 
         default:
@@ -653,7 +653,7 @@ void PlaylistManager::Run()
             else if(i_return == AbstractStream::buffering_full)
                 i_deadline += VLC_TICK_FROM_MS(100);
             else if(i_return == AbstractStream::buffering_end)
-                i_deadline += (CLOCK_FREQ);
+                i_deadline += VLC_TICK_FROM_SEC(1);
             else /*if(i_return == AbstractStream::buffering_suspended)*/
                 i_deadline += VLC_TICK_FROM_MS(250);
 
diff --git a/modules/demux/adaptive/playlist/BaseRepresentation.cpp b/modules/demux/adaptive/playlist/BaseRepresentation.cpp
index 4b7dbcdf79..d51923e001 100644
--- a/modules/demux/adaptive/playlist/BaseRepresentation.cpp
+++ b/modules/demux/adaptive/playlist/BaseRepresentation.cpp
@@ -121,7 +121,7 @@ vlc_tick_t BaseRepresentation::getMinAheadTime(uint64_t curnum) const
         }
 
         /* should not happen */
-        return CLOCK_FREQ;
+        return VLC_TICK_FROM_SEC(1);
     }
 
     vlc_tick_t minTime = 0;
diff --git a/modules/demux/adaptive/playlist/SegmentInformation.cpp b/modules/demux/adaptive/playlist/SegmentInformation.cpp
index 0d71d65ef0..160354117d 100644
--- a/modules/demux/adaptive/playlist/SegmentInformation.cpp
+++ b/modules/demux/adaptive/playlist/SegmentInformation.cpp
@@ -165,7 +165,7 @@ std::size_t SegmentInformation::getAllSegments(std::vector<ISegment *> &retSegme
 uint64_t SegmentInformation::getLiveStartSegmentNumber(uint64_t def) const
 {
     const vlc_tick_t i_max_buffering = getPlaylist()->getMaxBuffering() +
-                                    /* FIXME: add dynamic pts-delay */ CLOCK_FREQ;
+                                    /* FIXME: add dynamic pts-delay */ VLC_TICK_FROM_SEC(1);
 
     /* Try to never buffer up to really end */
     const uint64_t OFFSET_FROM_END = 3;
diff --git a/modules/demux/adaptive/plumbing/FakeESOut.cpp b/modules/demux/adaptive/plumbing/FakeESOut.cpp
index 26efb7a49a..e377759aa3 100644
--- a/modules/demux/adaptive/plumbing/FakeESOut.cpp
+++ b/modules/demux/adaptive/plumbing/FakeESOut.cpp
@@ -328,7 +328,7 @@ void FakeESOut::checkTimestampsStart(vlc_tick_t i_start)
     vlc_mutex_lock(&lock);
     if( !timestamps_check_done )
     {
-        if( i_start < CLOCK_FREQ ) /* Starts 0 */
+        if( i_start < VLC_TICK_FROM_SEC(1) ) /* Starts 0 */
             timestamps_offset = timestamps_expected;
         timestamps_check_done = true;
     }



More information about the vlc-commits mailing list