[vlc-devel] [PATCH 05/10] input: bookmarks: support fractional seconds

Filip Roséen filip at atch.se
Thu May 18 12:29:46 CEST 2017


---
 src/input/control.c | 4 ++--
 src/input/input.c   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/input/control.c b/src/input/control.c
index 51010fec77..8d9ad24dd7 100644
--- a/src/input/control.c
+++ b/src/input/control.c
@@ -586,8 +586,8 @@ static void UpdateBookmarksOption( input_thread_t *p_input )
 
         /* Append bookmark to option-buffer */
         /* TODO: escape inappropriate values */
-        vlc_memstream_printf( &vstr, "%s{name=%s,time=%" PRId64 "}",
-            i > 0 ? "," : "", sp->psz_name, sp->i_time_offset / CLOCK_FREQ );
+        vlc_memstream_printf( &vstr, "%s{name=%s,time=%.3f}",
+            i > 0 ? "," : "", sp->psz_name, ( 1. * sp->i_time_offset ) / CLOCK_FREQ );
     }
 
     vlc_mutex_unlock( &priv->p_item->lock );
diff --git a/src/input/input.c b/src/input/input.c
index 596317391a..ffe66f1275 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -437,7 +437,7 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
                      }
                      else if( !strncmp( psz_start, "time=", 5 ) )
                      {
-                         p_seekpoint->i_time_offset = atoll(psz_start + 5) *
+                         p_seekpoint->i_time_offset = atof(psz_start + 5) *
                                                         CLOCK_FREQ;
                      }
                      psz_start = psz_end + 1;
-- 
2.12.2


More information about the vlc-devel mailing list