mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-03 14:32:16 +02:00
lavf/segment: only use reference frames for computing the segment end time
This avoids a systematic overestimate of the segments duration when there are several streams. Fix trac ticket #3724.
This commit is contained in:
parent
88f038ac97
commit
5acad50056
@ -728,7 +728,7 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
seg->cur_entry.index = seg->segment_idx + seg->segment_idx_wrap*seg->segment_idx_wrap_nb;
|
||||
seg->cur_entry.start_time = (double)pkt->pts * av_q2d(st->time_base);
|
||||
seg->cur_entry.start_pts = av_rescale_q(pkt->pts, st->time_base, AV_TIME_BASE_Q);
|
||||
} else if (pkt->pts != AV_NOPTS_VALUE) {
|
||||
} else if (pkt->pts != AV_NOPTS_VALUE && pkt->stream_index == seg->reference_stream_index) {
|
||||
seg->cur_entry.end_time =
|
||||
FFMAX(seg->cur_entry.end_time, (double)(pkt->pts + pkt->duration) * av_q2d(st->time_base));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user