diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index e11cf69719e8a42bc330dab3017d910d4ae97be7..72d048484f7e38945649942cbfc87d2d67bc3293 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -214,8 +214,10 @@ static void output_segment_list(OutputStream *os, AVIOContext *out, DASHContext
                 Segment *seg = os->segments[i];
                 int repeat = 0;
                 avio_printf(out, "\t\t\t\t\t\t<S ");
-                if (i == start_index || seg->time != cur_time)
+                if (i == start_index || seg->time != cur_time) {
+                    cur_time = seg->time;
                     avio_printf(out, "t=\"%"PRId64"\" ", seg->time);
+                }
                 avio_printf(out, "d=\"%d\" ", seg->duration);
                 while (i + repeat + 1 < os->nb_segments &&
                        os->segments[i + repeat + 1]->duration == seg->duration &&