forked from FFmpeg/FFmpeg
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
This commit is contained in:
parent
c4f078ffe1
commit
96f69e0d87
1 changed files with 4 additions and 0 deletions
|
@ -1607,6 +1607,10 @@ static int mov_write_packet(AVFormatContext *s, AVPacket *pkt)
|
||||||
trk->cluster[trk->entry].dts = pkt->dts;
|
trk->cluster[trk->entry].dts = pkt->dts;
|
||||||
trk->trackDuration = pkt->dts - trk->cluster[0].dts + pkt->duration;
|
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)
|
if (pkt->dts != pkt->pts)
|
||||||
trk->hasBframes = 1;
|
trk->hasBframes = 1;
|
||||||
trk->cluster[trk->entry].cts = pkt->pts - pkt->dts;
|
trk->cluster[trk->entry].cts = pkt->pts - pkt->dts;
|
||||||
|
|
Loading…
Add table
Reference in a new issue