diff options
author | Bryan Huh <bryan@box.com> | 2015-11-14 18:23:20 -0800 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-11-16 01:53:47 +0100 |
commit | dfa98c4f839ea8bc447f370f97840977447a41c0 (patch) | |
tree | 62eda67637cd7fd4f7468155678ddb078d6885d8 /ffmpeg.c | |
parent | 7bf465abf3697dcddfb4021e6db9aeec1724f7ed (diff) | |
download | ffmpeg-dfa98c4f839ea8bc447f370f97840977447a41c0.tar.gz |
ffmpeg: Fixing typos and adding comments to fps code
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -984,11 +984,11 @@ static void do_video_out(AVFormatContext *s, ost->last_nb0_frames[1], ost->last_nb0_frames[2]); } else { - delta0 = sync_ipts - ost->sync_opts; + delta0 = sync_ipts - ost->sync_opts; // delta0 is the "drift" between the input frame (next_picture) and where it would fall in the output. delta = delta0 + duration; /* by default, we output a single frame */ - nb0_frames = 0; + nb0_frames = 0; // tracks the number of times the PREVIOUS frame should be duplicated, mostly for variable framerate (VFR) nb_frames = 1; format_video_sync = video_sync_method; @@ -1017,7 +1017,7 @@ static void do_video_out(AVFormatContext *s, if (delta0 < -0.6) { av_log(NULL, AV_LOG_WARNING, "Past duration %f too large\n", -delta0); } else - av_log(NULL, AV_LOG_DEBUG, "Cliping frame in rate conversion by %f\n", -delta0); + av_log(NULL, AV_LOG_DEBUG, "Clipping frame in rate conversion by %f\n", -delta0); sync_ipts += cor; duration -= cor; delta0 += cor; @@ -1066,22 +1066,22 @@ static void do_video_out(AVFormatContext *s, sizeof(ost->last_nb0_frames[0]) * (FF_ARRAY_ELEMS(ost->last_nb0_frames) - 1)); ost->last_nb0_frames[0] = nb0_frames; - if (nb0_frames == 0 && ost->last_droped) { + if (nb0_frames == 0 && ost->last_dropped) { nb_frames_drop++; av_log(NULL, AV_LOG_VERBOSE, "*** dropping frame %d from stream %d at ts %"PRId64"\n", ost->frame_number, ost->st->index, ost->last_frame->pts); } - if (nb_frames > (nb0_frames && ost->last_droped) + (nb_frames > nb0_frames)) { + if (nb_frames > (nb0_frames && ost->last_dropped) + (nb_frames > nb0_frames)) { if (nb_frames > dts_error_threshold * 30) { av_log(NULL, AV_LOG_ERROR, "%d frame duplication too large, skipping\n", nb_frames - 1); nb_frames_drop++; return; } - nb_frames_dup += nb_frames - (nb0_frames && ost->last_droped) - (nb_frames > nb0_frames); + nb_frames_dup += nb_frames - (nb0_frames && ost->last_dropped) - (nb_frames > nb0_frames); av_log(NULL, AV_LOG_VERBOSE, "*** %d dup!\n", nb_frames - 1); } - ost->last_droped = nb_frames == nb0_frames && next_picture; + ost->last_dropped = nb_frames == nb0_frames && next_picture; /* duplicates frame if needed */ for (i = 0; i < nb_frames; i++) { @@ -1632,7 +1632,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti pts = FFMAX(pts, av_rescale_q(av_stream_get_end_pts(ost->st), ost->st->time_base, AV_TIME_BASE_Q)); if (is_last_report) - nb_frames_drop += ost->last_droped; + nb_frames_drop += ost->last_dropped; } secs = FFABS(pts) / AV_TIME_BASE; |