[vlc-commits] demux: adaptive: fix rounding in period/playlist duration
Francois Cartegnie
git at videolan.org
Mon May 25 15:11:22 CEST 2020
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon May 25 14:59:41 2020 +0200| [19fc4c591f31d0370822892dbff08709c02ae20a] | committer: Francois Cartegnie
demux: adaptive: fix rounding in period/playlist duration
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=19fc4c591f31d0370822892dbff08709c02ae20a
---
modules/demux/adaptive/tools/Conversions.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/modules/demux/adaptive/tools/Conversions.cpp b/modules/demux/adaptive/tools/Conversions.cpp
index f808c3822a..fc7434e335 100644
--- a/modules/demux/adaptive/tools/Conversions.cpp
+++ b/modules/demux/adaptive/tools/Conversions.cpp
@@ -35,10 +35,10 @@
Exemple input string: "PT0H9M56.46S"
*/
-static time_t str_duration( const char *psz_duration )
+static vlc_tick_t str_duration( const char *psz_duration )
{
bool timeDesignatorReached = false;
- time_t res = 0;
+ vlc_tick_t res = 0;
char* end_ptr;
if ( psz_duration == NULL )
@@ -79,7 +79,7 @@ static time_t str_duration( const char *psz_duration )
default:
break ;
}
- res += (time_t)(mul * number);
+ res += vlc_tick_from_sec(mul * number);
if ( *psz_duration )
psz_duration++;
} while ( *psz_duration );
@@ -88,7 +88,7 @@ static time_t str_duration( const char *psz_duration )
IsoTime::IsoTime(const std::string &str)
{
- time = vlc_tick_from_sec(str_duration(str.c_str()));
+ time = str_duration(str.c_str());
}
IsoTime::operator vlc_tick_t () const
More information about the vlc-commits
mailing list