summaryrefslogtreecommitdiff
path: root/libavformat/hlsenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-09-13 23:06:06 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-09-13 23:44:35 +0200
commit9f18a970b2df951007266ac80093723db5638599 (patch)
tree8858707a8146b397e19d57676d94e1a4ea981a1b /libavformat/hlsenc.c
parent22ba9a3cb8c0e7069d03cf8b142ddbfc5f65ba38 (diff)
avformat/hlsenc: Assume UTC if "%z" is unsupported in strftime()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/hlsenc.c')
-rw-r--r--libavformat/hlsenc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 157dbd4d34..46b439d796 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -545,7 +545,8 @@ static int hls_window(AVFormatContext *s, int last)
milli = av_clip(lrint(1000*(prog_date_time - tt)), 0, 999);
tm = localtime_r(&tt, &tmpbuf);
strftime(buf0, sizeof(buf0), "%Y-%m-%dT%H:%M:%S", tm);
- strftime(buf1, sizeof(buf1), "%z", tm);
+ if (!strftime(buf1, sizeof(buf1), "%z", tm))
+ av_strlcpy(buf1, "Z", sizeof(buf1));
avio_printf(out, "#EXT-X-PROGRAM-DATE-TIME:%s.%03d%s\n", buf0, milli, buf1);
prog_date_time += en->duration;
}