[vlc-commits] core: use vlc_tick_t for seekpoint_t::i_time_offset officially

Steve Lhomme git at videolan.org
Thu Sep 20 12:43:53 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Sat May  5 17:12:06 2018 +0200| [a856cc14602f0a7f388734ff776c33c2151feb8b] | committer: Steve Lhomme

core: use vlc_tick_t for seekpoint_t::i_time_offset officially

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

 include/vlc_input.h                    | 2 +-
 lib/media_player.c                     | 4 ++--
 modules/access/vdr.c                   | 2 +-
 modules/demux/mkv/mkv.cpp              | 4 ++--
 modules/demux/xiph_metadata.c          | 2 +-
 modules/gui/qt/adapters/seekpoints.hpp | 2 +-
 modules/gui/qt/styles/seekstyle.hpp    | 2 +-
 src/input/input.c                      | 2 +-
 8 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/vlc_input.h b/include/vlc_input.h
index afdcde8816..88d1da091f 100644
--- a/include/vlc_input.h
+++ b/include/vlc_input.h
@@ -49,7 +49,7 @@
  *****************************************************************************/
 struct seekpoint_t
 {
-    int64_t i_time_offset;
+    vlc_tick_t i_time_offset;
     char    *psz_name;
 };
 
diff --git a/lib/media_player.c b/lib/media_player.c
index e299f823b3..9bf9ef983e 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -1652,11 +1652,11 @@ int libvlc_media_player_get_full_chapter_descriptions( libvlc_media_player_t *p_
         }
         (*pp_chapters)[i] = p_chapter;
 
-        p_chapter->i_time_offset = p_seekpoint[i]->i_time_offset / 1000;
+        p_chapter->i_time_offset = MS_FROM_VLC_TICK( p_seekpoint[i]->i_time_offset );
 
         if( i < ci_chapter_count - 1 )
         {
-            p_chapter->i_duration = p_seekpoint[i + 1]->i_time_offset / 1000 -
+            p_chapter->i_duration = MS_FROM_VLC_TICK( p_seekpoint[i + 1]->i_time_offset ) -
                                     p_chapter->i_time_offset;
         }
         else
diff --git a/modules/access/vdr.c b/modules/access/vdr.c
index 0f20a679b3..66376d2e18 100644
--- a/modules/access/vdr.c
+++ b/modules/access/vdr.c
@@ -862,7 +862,7 @@ static void ImportMarks( stream_t *p_access )
         seekpoint_t *sp = vlc_seekpoint_New();
         if( !sp )
             continue;
-        sp->i_time_offset = i_frame * (int64_t)( CLOCK_FREQ / p_sys->fps );
+        sp->i_time_offset = i_frame * (vlc_tick_t)( CLOCK_FREQ / p_sys->fps );
         sp->psz_name = strdup( line );
 
         TAB_APPEND( p_marks->i_seekpoint, p_marks->seekpoint, sp );
diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index 84c56590c9..352e84139e 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -382,7 +382,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
                 p_sys->p_current_vsegment->i_current_edition = i_idx;
                 p_sys->i_current_title = i_idx;
                 if( VLC_SUCCESS ==
-                    Seek( p_demux, static_cast<vlc_tick_t>( p_sys->titles[i_idx]->seekpoint[0]->i_time_offset ), -1, NULL) )
+                    Seek( p_demux, p_sys->titles[i_idx]->seekpoint[0]->i_time_offset, -1, NULL) )
                 {
                     p_sys->i_updates |= INPUT_UPDATE_SEEKPOINT|INPUT_UPDATE_TITLE;
                     p_sys->i_current_seekpoint = 0;
@@ -403,7 +403,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             // TODO change the way it works with the << & >> buttons on the UI (+1/-1 instead of a number)
             if( p_sys->titles.size() && i_skp < p_sys->titles[p_sys->i_current_title]->i_seekpoint)
             {
-                int i_ret = Seek( p_demux, static_cast<vlc_tick_t>( p_sys->titles[p_sys->i_current_title]->seekpoint[i_skp]->i_time_offset ), -1, NULL);
+                int i_ret = Seek( p_demux, p_sys->titles[p_sys->i_current_title]->seekpoint[i_skp]->i_time_offset, -1, NULL);
                 if( i_ret == VLC_SUCCESS )
                 {
                     p_sys->i_updates |= INPUT_UPDATE_SEEKPOINT;
diff --git a/modules/demux/xiph_metadata.c b/modules/demux/xiph_metadata.c
index 3137dbc296..de3748418f 100644
--- a/modules/demux/xiph_metadata.c
+++ b/modules/demux/xiph_metadata.c
@@ -296,7 +296,7 @@ static void xiph_ParseCueSheetMeta( unsigned *pi_flags, vlc_meta_t *p_meta,
         unsigned m, s, f;
         if( sscanf( &psz_line[13], "%u:%u:%u", &m, &s, &f ) == 3 )
         {
-            p_seekpoint->i_time_offset = CLOCK_FREQ * (m * 60 + s) + f * CLOCK_FREQ/75;
+            p_seekpoint->i_time_offset = vlc_tick_from_sec(m * 60 + s) + f * CLOCK_FREQ/75;
             *pb_valid = true;
         }
     }
diff --git a/modules/gui/qt/adapters/seekpoints.hpp b/modules/gui/qt/adapters/seekpoints.hpp
index 008398990a..9ab8343bca 100644
--- a/modules/gui/qt/adapters/seekpoints.hpp
+++ b/modules/gui/qt/adapters/seekpoints.hpp
@@ -42,7 +42,7 @@ public:
         time = seekpoint->i_time_offset;
         name = QString::fromUtf8( seekpoint->psz_name );
     };
-    int64_t time;
+    vlc_tick_t time;
     QString name;
 };
 
diff --git a/modules/gui/qt/styles/seekstyle.hpp b/modules/gui/qt/styles/seekstyle.hpp
index 15390ceac3..1a165f793c 100644
--- a/modules/gui/qt/styles/seekstyle.hpp
+++ b/modules/gui/qt/styles/seekstyle.hpp
@@ -42,7 +42,7 @@ public:
         bool animate;
         qreal animationopacity;
         qreal animationloading;
-        QList<int64_t> points;
+        QList<vlc_tick_t> points;
     };
 
 public:
diff --git a/src/input/input.c b/src/input/input.c
index 48eaf3e1d5..e6aaaccc7c 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -2156,7 +2156,7 @@ static bool Control( input_thread_t *p_input,
 
             if( i_type == INPUT_CONTROL_SET_SEEKPOINT_PREV )
             {
-                int64_t i_seekpoint_time = priv->master->title[i_title]->seekpoint[i_seekpoint]->i_time_offset;
+                vlc_tick_t i_seekpoint_time = priv->master->title[i_title]->seekpoint[i_seekpoint]->i_time_offset;
                 int64_t i_input_time = var_GetInteger( p_input, "time" );
                 if( i_seekpoint_time >= 0 && i_input_time >= 0 )
                 {



More information about the vlc-commits mailing list