Commit 973684a4 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '456e93bf'

* commit '456e93bf':
  dashenc: Adjust the start time of a segment to the end of the previous segment
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents b32cb08b 456e93bf
......@@ -654,6 +654,7 @@ static int dash_write_header(AVFormatContext *s)
set_codec_str(s, os->ctx->streams[0]->codec, os->codec_str, sizeof(os->codec_str));
os->first_dts = AV_NOPTS_VALUE;
os->end_dts = AV_NOPTS_VALUE;
os->segment_index = 1;
}
......@@ -863,8 +864,15 @@ static int dash_write_packet(AVFormatContext *s, AVPacket *pkt)
return ret;
}
if (!os->packets_written)
os->start_dts = pkt->dts;
if (!os->packets_written) {
// 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;
else
os->start_dts = pkt->dts;
}
os->end_dts = pkt->dts + pkt->duration;
os->packets_written++;
return ff_write_chained(os->ctx, 0, pkt, s, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment