Merge commit '7a1a63e34fa46af18311c2493fdaec9a93bdb750'
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 3 Jan 2015 03:26:05 +0000 (04:26 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 3 Jan 2015 03:26:20 +0000 (04:26 +0100)
* commit '7a1a63e34fa46af18311c2493fdaec9a93bdb750':
  dashenc: Use pts for MPD timeline timestamps

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavformat/dashenc.c

@@@ -875,14 -876,17 +878,17 @@@ static int dash_write_packet(AVFormatCo
          // If we wrote a previous segment, adjust the start time of the segment
          // to the end of the previous one (which is the same as the mp4 muxer
          // does). This avoids gaps in the timeline.
-         if (os->end_dts != AV_NOPTS_VALUE)
-             os->start_dts = os->end_dts;
+         if (os->max_pts != AV_NOPTS_VALUE)
+             os->start_pts = os->max_pts;
          else
-             os->start_dts = pkt->dts;
+             os->start_pts = pkt->pts;
      }
-     os->end_dts = pkt->dts + pkt->duration;
+     if (os->max_pts == AV_NOPTS_VALUE)
+         os->max_pts = pkt->pts + pkt->duration;
+     else
+         os->max_pts = FFMAX(os->max_pts, pkt->pts + pkt->duration);
      os->packets_written++;
 -    return ff_write_chained(os->ctx, 0, pkt, s);
 +    return ff_write_chained(os->ctx, 0, pkt, s, 0);
  }
  
  static int dash_write_trailer(AVFormatContext *s)