[vlc-commits] input: bookmarks: support fractional seconds
Filip Roséen
git at videolan.org
Thu May 18 18:21:05 CEST 2017
vlc | branch: master | Filip Roséen <filip at atch.se> | Thu May 18 12:29:46 2017 +0200| [051aed339c1bc595e1322b0542f0db05b197ce77] | committer: Rémi Denis-Courmont
input: bookmarks: support fractional seconds
Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=051aed339c1bc595e1322b0542f0db05b197ce77
---
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 17b87823e4..d4ddf28b2c 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;
More information about the vlc-commits
mailing list