diff options
author | Clément Bœsch <u@pkh.me> | 2017-05-20 17:55:22 +0300 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2017-05-20 17:55:22 +0300 |
commit | 1a950f32abf3bb0de7a94b26be2dfa62810ffc28 (patch) | |
tree | 99e696f4fe718695d67d9a0fa44990def73c7090 /libavformat | |
parent | e815111367cba1ec168ae080a6503e5b3eb326bf (diff) | |
parent | e519dcd937c7c98815ba9884867590e302272016 (diff) |
Merge commit 'e519dcd937c7c98815ba9884867590e302272016'
* commit 'e519dcd937c7c98815ba9884867590e302272016':
dashenc: separate segments based on current segment duration
Merged-by: Clément Bœsch <u@pkh.me>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/dashenc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index 5b27941852..0f234bb0b5 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -926,7 +926,6 @@ static int dash_write_packet(AVFormatContext *s, AVPacket *pkt) DASHContext *c = s->priv_data; AVStream *st = s->streams[pkt->stream_index]; OutputStream *os = &c->streams[pkt->stream_index]; - int64_t seg_end_duration = (os->segment_index) * (int64_t) c->min_seg_duration; int ret; ret = update_stream_extradata(s, os, st->codecpar); @@ -956,8 +955,8 @@ static int dash_write_packet(AVFormatContext *s, AVPacket *pkt) if ((!c->has_video || st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) && pkt->flags & AV_PKT_FLAG_KEY && os->packets_written && - av_compare_ts(pkt->pts - os->first_pts, st->time_base, - seg_end_duration, AV_TIME_BASE_Q) >= 0) { + av_compare_ts(pkt->pts - os->start_pts, st->time_base, + c->min_seg_duration, AV_TIME_BASE_Q) >= 0) { int64_t prev_duration = c->last_duration; c->last_duration = av_rescale_q(pkt->pts - os->start_pts, |