Mercurial > libavformat.hg
changeset 3397:76918939de90 libavformat
warn if pts is not set, prevent writing negative/weird cts, happens when using genpts and streamcopy
author | bcoudurier |
---|---|
date | Thu, 29 May 2008 00:58:41 +0000 |
parents | f7f09ceea992 |
children | 3fbe87561b73 |
files | movenc.c |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/movenc.c Thu May 29 00:54:33 2008 +0000 +++ b/movenc.c Thu May 29 00:58:41 2008 +0000 @@ -1607,6 +1607,10 @@ trk->cluster[trk->entry].dts = pkt->dts; trk->trackDuration = pkt->dts - trk->cluster[0].dts + pkt->duration; + if (pkt->pts == AV_NOPTS_VALUE) { + av_log(s, AV_LOG_WARNING, "pts has no value\n"); + pkt->pts = pkt->dts; + } if (pkt->dts != pkt->pts) trk->hasBframes = 1; trk->cluster[trk->entry].cts = pkt->pts - pkt->dts;