diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-12-30 14:11:11 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-12-30 14:11:17 +0100 |
commit | 56c71cd599862e02c4b579efe8eace376933efd4 (patch) | |
tree | e15d5644c509d47b953c545d7fff2d57cf0729e8 | |
parent | 19e1c8e4f203a9445aadfc683449968a59f9aa81 (diff) | |
parent | 9b1370aced385698bc783747917544ab69ecb373 (diff) | |
download | ffmpeg-56c71cd599862e02c4b579efe8eace376933efd4.tar.gz |
Merge commit '9b1370aced385698bc783747917544ab69ecb373'
* commit '9b1370aced385698bc783747917544ab69ecb373':
hlsenc: do not add timestamps in different timebases
hlsenc: use the correct AV_TIME_BASE macro
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/hlsenc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index ae1184a35f..eafaf452c3 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -189,7 +189,7 @@ static int hls_write_header(AVFormatContext *s) hls->number = 0; - hls->recording_time = hls->time * 1000000; + hls->recording_time = hls->time * AV_TIME_BASE; hls->start_pts = AV_NOPTS_VALUE; for (i = 0; i < s->nb_streams; i++) @@ -255,10 +255,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, |