diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-05-29 00:58:41 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-05-29 00:58:41 +0000 |
commit | 96f69e0d87777a830776992f591fcf4e33ea8368 (patch) | |
tree | 3895622fe1377014b9d428bedb06e172dcd0ef4a | |
parent | c4f078ffe1317dc1ef82622987776bc39f310865 (diff) | |
download | ffmpeg-96f69e0d87777a830776992f591fcf4e33ea8368.tar.gz |
warn if pts is not set, prevent writing negative/weird cts, happens when using genpts and streamcopy
Originally committed as revision 13519 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/movenc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 49c30b0070..e4f7066f12 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -1607,6 +1607,10 @@ static int mov_write_packet(AVFormatContext *s, AVPacket *pkt) 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; |