[FFmpeg-cvslog] hlsenc: do not add timestamps in different timebases

Luca Barbato git at videolan.org
Sun Dec 30 14:21:31 CET 2012


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Sat Dec 29 11:46:01 2012 +0100| [9b1370aced385698bc783747917544ab69ecb373] | committer: Luca Barbato

hlsenc: do not add timestamps in different timebases

start_time is in stream timebase units while end_time is
in AV_TIME_BASE ones.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9b1370aced385698bc783747917544ab69ecb373
---

 libavformat/hlsenc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 71c0c34..43b3505 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,



More information about the ffmpeg-cvslog mailing list