X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=ffmpeg.c;h=becd5dfc3367fb950389fc477b2f25d0cfafb85f;hb=cb9d40451cb2f9d863355f76aa62ef8e5fcf4960;hp=9cff55714c181f1cfa7c9c50f6c5b08adfe4cc07;hpb=bd12634d6b83e196515c52ccaa9b7513c1023b6f;p=ffmpeg diff --git a/ffmpeg.c b/ffmpeg.c index 9cff55714c1..becd5dfc336 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -962,7 +962,9 @@ static void do_video_out(AVFormatContext *s, } case VSYNC_CFR: // FIXME set to 0.5 after we fix some dts/pts bugs like in avidec.c - if (delta < -1.1) + if (frame_drop_threshold && delta < frame_drop_threshold && ost->frame_number) { + nb_frames = 0; + } else if (delta < -1.1) nb_frames = 0; else if (delta > 1.1) { nb_frames = lrintf(delta); @@ -1526,8 +1528,8 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti nb_frames_drop += ost->last_droped; } - secs = pts / AV_TIME_BASE; - us = pts % AV_TIME_BASE; + secs = FFABS(pts) / AV_TIME_BASE; + us = FFABS(pts) % AV_TIME_BASE; mins = secs / 60; secs %= 60; hours = mins / 60; @@ -1539,6 +1541,8 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti "size=N/A time="); else snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "size=%8.0fkB time=", total_size / 1024.0); + if (pts < 0) + snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "-"); snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%02d:%02d:%02d.%02d ", hours, mins, secs, (100 * us) / AV_TIME_BASE);