Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
b6d96a6b
Commit
b6d96a6b
authored
Jan 17, 2019
by
Karthick J
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/dashenc: Format xs:datetime in millisecond precision
For low latency streaming even milliseconds matter!
parent
62f8d27e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
dashenc.c
libavformat/dashenc.c
+12
-3
No files found.
libavformat/dashenc.c
View file @
b6d96a6b
...
...
@@ -32,6 +32,7 @@
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/rational.h"
#include "libavutil/time.h"
#include "libavutil/time_internal.h"
#include "avc.h"
...
...
@@ -668,12 +669,20 @@ static void write_time(AVIOContext *out, int64_t time)
static
void
format_date_now
(
char
*
buf
,
int
size
)
{
time_t
t
=
time
(
NULL
);
struct
tm
*
ptm
,
tmbuf
;
ptm
=
gmtime_r
(
&
t
,
&
tmbuf
);
int64_t
time_us
=
av_gettime
();
int64_t
time_ms
=
time_us
/
1000
;
const
time_t
time_s
=
time_ms
/
1000
;
int
millisec
=
time_ms
-
(
time_s
*
1000
);
ptm
=
gmtime_r
(
&
time_s
,
&
tmbuf
);
if
(
ptm
)
{
if
(
!
strftime
(
buf
,
size
,
"%Y-%m-%dT%H:%M:%SZ"
,
ptm
))
int
len
;
if
(
!
strftime
(
buf
,
size
,
"%Y-%m-%dT%H:%M:%S"
,
ptm
))
{
buf
[
0
]
=
'\0'
;
return
;
}
len
=
strlen
(
buf
);
snprintf
(
buf
+
len
,
size
-
len
,
".%03dZ"
,
millisec
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment