Skip to content
Snippets Groups Projects
Commit 03ea0eb5 authored by Filip Roséen's avatar Filip Roséen Committed by Hugo Beauzée-Luyssen
Browse files

demux/ttml: Convert_time: refactor redundant call to sscanf


Given that the only difference between "%d:%d:%d,%d" and "%d:%d:%d.%d"
is the delimiter used between s1 and d1, a common format has replaced
the two that will accept both.

Signed-off-by: default avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent 21da9e6e
No related branches found
No related tags found
No related merge requests found
......@@ -165,8 +165,7 @@ static int Convert_time( int64_t *timing_value, const char *s )
int d1 = 0;
if ( sscanf( s, "%d.%ds", &s1, &d1) == 2 ||
sscanf( s, "%d:%d:%d,%d", &h1, &m1, &s1, &d1 ) == 4 ||
sscanf( s, "%d:%d:%d.%d", &h1, &m1, &s1, &d1 ) == 4 ||
sscanf( s, "%d:%d:%d%*[,.]%d", &h1, &m1, &s1, &d1 ) == 4 ||
sscanf( s, "%d:%d:%d", &h1, &m1, &s1) == 3 )
{
(*timing_value) = ( (int64_t)h1 * 3600 * 1000 +
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment