aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorVignesh Venkatasubramanian <vigneshv@google.com>2015-04-07 12:21:02 -0700
committerMichael Niedermayer <michaelni@gmx.at>2015-04-07 21:29:20 +0200
commitd6bb82387c1232a5e84650b979d46477fb9693db (patch)
tree9ec80e84c50f67b109b6e446f0cb29fcfadcc025 /libavformat
parent9c37c81246146ef45bba59546cc611a6e26a5b21 (diff)
downloadffmpeg-d6bb82387c1232a5e84650b979d46477fb9693db.tar.gz
webmdashenc: Fix fate in MSVC
MSVC does not support the %F and %T format specifiers in strftime. Replace that with the expanded version. This fixes the broken fate tests in MSVC (webm-dash-manifest-*). Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/webmdashenc.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/libavformat/webmdashenc.c b/libavformat/webmdashenc.c
index 37646deb2c..c5347a98e4 100644
--- a/libavformat/webmdashenc.c
+++ b/libavformat/webmdashenc.c
@@ -91,9 +91,6 @@ static void write_header(AVFormatContext *s)
{
WebMDashMuxContext *w = s->priv_data;
double min_buffer_time = 1.0;
- time_t local_time;
- struct tm *gmt, gmt_buffer;
- char *gmt_iso = av_malloc(21);
avio_printf(s->pb, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
avio_printf(s->pb, "<MPD\n");
avio_printf(s->pb, " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n");
@@ -108,13 +105,15 @@ static void write_header(AVFormatContext *s)
avio_printf(s->pb, " profiles=\"%s\"%s",
w->is_live ? "urn:mpeg:dash:profile:isoff-live:2011" : "urn:webm:dash:profile:webm-on-demand:2012",
w->is_live ? "\n" : ">\n");
- time(&local_time);
- gmt = gmtime_r(&local_time, &gmt_buffer);
- strftime(gmt_iso, 21, "%FT%TZ", gmt);
- if (w->debug_mode) {
- av_strlcpy(gmt_iso, "", 1);
- }
if (w->is_live) {
+ time_t local_time = time(NULL);
+ struct tm gmt_buffer;
+ struct tm *gmt = gmtime_r(&local_time, &gmt_buffer);
+ char *gmt_iso = av_malloc(21);
+ strftime(gmt_iso, 21, "%Y-%m-%dT%H:%M:%SZ", gmt);
+ if (w->debug_mode) {
+ av_strlcpy(gmt_iso, "", 1);
+ }
avio_printf(s->pb, " availabilityStartTime=\"%s\"\n", gmt_iso);
avio_printf(s->pb, " timeShiftBufferDepth=\"PT%gS\"", w->time_shift_buffer_depth);
avio_printf(s->pb, ">\n");
@@ -123,8 +122,8 @@ static void write_header(AVFormatContext *s)
w->utc_timing_url ? "urn:mpeg:dash:utc:http-iso:2014" : "urn:mpeg:dash:utc:direct:2012");
avio_printf(s->pb, " value=\"%s\"/>\n",
w->utc_timing_url ? w->utc_timing_url : gmt_iso);
+ av_free(gmt_iso);
}
- av_free(gmt_iso);
}
static void write_footer(AVFormatContext *s)