Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
a52cb42b
Commit
a52cb42b
authored
10 years ago
by
Michael Niedermayer
Browse files
Options
Downloads
Patches
Plain Diff
avformat/matroskadec: use gmtime_r() for thread saftey
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
70b7cf9c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavformat/matroskadec.c
+2
-1
2 additions, 1 deletion
libavformat/matroskadec.c
with
2 additions
and
1 deletion
libavformat/matroskadec.c
+
2
−
1
View file @
a52cb42b
...
@@ -46,6 +46,7 @@
...
@@ -46,6 +46,7 @@
#include
"libavutil/intreadwrite.h"
#include
"libavutil/intreadwrite.h"
#include
"libavutil/lzo.h"
#include
"libavutil/lzo.h"
#include
"libavutil/mathematics.h"
#include
"libavutil/mathematics.h"
#include
"libavutil/time_internal.h"
#include
"libavcodec/bytestream.h"
#include
"libavcodec/bytestream.h"
#include
"libavcodec/flac.h"
#include
"libavcodec/flac.h"
...
@@ -1507,7 +1508,7 @@ static void matroska_metadata_creation_time(AVDictionary **metadata, int64_t dat
...
@@ -1507,7 +1508,7 @@ static void matroska_metadata_creation_time(AVDictionary **metadata, int64_t dat
char
buffer
[
32
];
char
buffer
[
32
];
/* Convert to seconds and adjust by number of seconds between 2001-01-01 and Epoch */
/* Convert to seconds and adjust by number of seconds between 2001-01-01 and Epoch */
time_t
creation_time
=
date_utc
/
1000000000
+
978307200
;
time_t
creation_time
=
date_utc
/
1000000000
+
978307200
;
struct
tm
*
ptm
=
gmtime
(
&
creation_time
);
struct
tm
tmpbuf
,
*
ptm
=
gmtime
_r
(
&
creation_time
,
&
tmpbuf
);
if
(
!
ptm
)
return
;
if
(
!
ptm
)
return
;
if
(
strftime
(
buffer
,
sizeof
(
buffer
),
"%Y-%m-%d %H:%M:%S"
,
ptm
))
if
(
strftime
(
buffer
,
sizeof
(
buffer
),
"%Y-%m-%d %H:%M:%S"
,
ptm
))
av_dict_set
(
metadata
,
"creation_time"
,
buffer
,
0
);
av_dict_set
(
metadata
,
"creation_time"
,
buffer
,
0
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment