Commit 9fbf21e4 authored by bcoudurier's avatar bcoudurier

warn if pts is not set, prevent writing negative/weird cts, happens when using...

warn if pts is not set, prevent writing negative/weird cts, happens when using genpts and streamcopy

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@13519 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent b4a5daf5
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment