[FFmpeg-cvslog] avformat/hlsenc: Assume UTC if "%z" is unsupported in strftime()

Michael Niedermayer git at videolan.org
Wed Sep 14 00:49:05 EEST 2016


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Tue Sep 13 23:06:06 2016 +0200| [9f18a970b2df951007266ac80093723db5638599] | committer: Michael Niedermayer

avformat/hlsenc: Assume UTC if "%z" is unsupported in strftime()

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9f18a970b2df951007266ac80093723db5638599
---

 libavformat/hlsenc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 157dbd4..46b439d 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;
         }



More information about the ffmpeg-cvslog mailing list