else
ost->error[i] = -1;
}
+
+ if (ost->frame_rate.num && ost->is_cfr) {
+ if (pkt->duration > 0)
+ av_log(NULL, AV_LOG_WARNING, "Overriding packet duration by frame rate, this should not happen\n");
+ pkt->duration = av_rescale_q(1, av_inv_q(ost->frame_rate),
+ ost->st->time_base);
+ }
}
if (bsfc)
format_video_sync = VSYNC_VSCFR;
}
}
+ ost->is_cfr = (format_video_sync == VSYNC_CFR || format_video_sync == VSYNC_VSCFR);
if (delta0 < 0 &&
delta > 0 &&
for (i = 0; i < nb_output_streams; i++) {
OutputStream *ost = output_streams[i];
- int64_t opts = av_rescale_q(ost->st->cur_dts, ost->st->time_base,
+ int64_t opts = ost->st->cur_dts == AV_NOPTS_VALUE ? INT64_MIN :
+ av_rescale_q(ost->st->cur_dts, ost->st->time_base,
AV_TIME_BASE_Q);
+ if (ost->st->cur_dts == AV_NOPTS_VALUE)
+ av_log(NULL, AV_LOG_DEBUG, "cur_dts is invalid (this is harmless if it occurs once at the start per stream)\n");
+
if (!ost->finished && opts < opts_min) {
opts_min = opts;
ost_min = ost->unavailable ? NULL : ost;