mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
hlsenc: do not add timestamps in different timebases
start_time is in stream timebase units while end_time is in AV_TIME_BASE ones.
This commit is contained in:
parent
0d8cc7a3b2
commit
9b1370aced
@ -253,10 +253,10 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
hls->start_pts = pkt->pts;
|
||||
hls->end_pts = pkt->pts;
|
||||
}
|
||||
end_pts += hls->start_pts;
|
||||
|
||||
if ((hls->has_video && st->codec->codec_type == AVMEDIA_TYPE_VIDEO) &&
|
||||
av_compare_ts(pkt->pts, st->time_base, end_pts, AV_TIME_BASE_Q) >= 0 &&
|
||||
av_compare_ts(pkt->pts - hls->start_pts, st->time_base,
|
||||
end_pts, AV_TIME_BASE_Q) >= 0 &&
|
||||
pkt->flags & AV_PKT_FLAG_KEY) {
|
||||
|
||||
ret = append_entry(hls, av_rescale(pkt->pts - hls->end_pts,
|
||||
|
Loading…
Reference in New Issue
Block a user