summaryrefslogtreecommitdiff
path: root/libavformat/wavenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-11-02 20:08:12 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-11-02 20:08:12 +0100
commit76886589eea7172f3a1fe8535e2c679abcc3ea51 (patch)
treeb5768d74ed2476c32f36f10fd97dd3d245e91a00 /libavformat/wavenc.c
parent32a2876b12f6e839292b0ee699ff7bd0f11ed4d4 (diff)
downloadffmpeg-76886589eea7172f3a1fe8535e2c679abcc3ea51.tar.gz
avformat/wavenc: Use localtime_r() for thread saftey
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/wavenc.c')
-rw-r--r--libavformat/wavenc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/wavenc.c b/libavformat/wavenc.c
index c73c9009d5..bce4876976 100644
--- a/libavformat/wavenc.c
+++ b/libavformat/wavenc.c
@@ -38,6 +38,7 @@
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/time.h"
+#include "libavutil/time_internal.h"
#include "avformat.h"
#include "avio.h"
@@ -267,10 +268,11 @@ static void peak_write_chunk(AVFormatContext *s)
memset(timestamp, 0, sizeof(timestamp));
if (!(s->flags & AVFMT_FLAG_BITEXACT)) {
+ struct tm tmpbuf;
av_log(s, AV_LOG_INFO, "Writing local time and date to Peak Envelope Chunk\n");
now0 = av_gettime();
now_secs = now0 / 1000000;
- strftime(timestamp, sizeof(timestamp), "%Y:%m:%d:%H:%M:%S:", localtime(&now_secs));
+ strftime(timestamp, sizeof(timestamp), "%Y:%m:%d:%H:%M:%S:", localtime_r(&now_secs, &tmpbuf));
av_strlcatf(timestamp, sizeof(timestamp), "%03d", (int)((now0 / 1000) % 1000));
}