aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2012-12-29 11:46:01 +0100
committerLuca Barbato <lu_zero@gentoo.org>2012-12-29 17:26:30 +0100
commit9b1370aced385698bc783747917544ab69ecb373 (patch)
tree7e1a98318a3670c1874f5be29079830dd6eaa21d
parent0d8cc7a3b223fe23db87189f2410e624e672b66e (diff)
downloadffmpeg-9b1370aced385698bc783747917544ab69ecb373.tar.gz
hlsenc: do not add timestamps in different timebases
start_time is in stream timebase units while end_time is in AV_TIME_BASE ones.
-rw-r--r--libavformat/hlsenc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 71c0c34681..43b3505f3c 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -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,