summaryrefslogtreecommitdiff
path: root/fftools/ffmpeg.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-03-31 17:10:55 +0200
committerAnton Khirnov <anton@khirnov.net>2022-07-23 11:53:19 +0200
commit4403851ca92d2eedb098a27cf91744e7e234c136 (patch)
tree81436ca00ac078e3e6ef9bd6148fea8ecfb4e32d /fftools/ffmpeg.c
parent4cd19eaffa1fba01a7e8622a0f47f210ca4e8bcf (diff)
fftools/ffmpeg: only set OutputStream.frame_number for video encoding
It is unused otherwise. Rename the field to vsync_frame_number to better reflect its current purpose.
Diffstat (limited to 'fftools/ffmpeg.c')
-rw-r--r--fftools/ffmpeg.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index b512eb5a19..fdffa31cf0 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -1184,7 +1184,7 @@ static void do_video_out(OutputFile *of,
switch (ost->vsync_method) {
case VSYNC_VSCFR:
- if (ost->frame_number == 0 && delta0 >= 0.5) {
+ if (ost->vsync_frame_number == 0 && delta0 >= 0.5) {
av_log(NULL, AV_LOG_DEBUG, "Not duplicating %d initial frames\n", (int)lrintf(delta0));
delta = duration;
delta0 = 0;
@@ -1192,7 +1192,7 @@ static void do_video_out(OutputFile *of,
}
case VSYNC_CFR:
// FIXME set to 0.5 after we fix some dts/pts bugs like in avidec.c
- if (frame_drop_threshold && delta < frame_drop_threshold && ost->frame_number) {
+ if (frame_drop_threshold && delta < frame_drop_threshold && ost->vsync_frame_number) {
nb_frames = 0;
} else if (delta < -1.1)
nb_frames = 0;
@@ -1225,7 +1225,7 @@ static void do_video_out(OutputFile *of,
* But there may be reordering, so we can't throw away frames on encoder
* flush, we need to limit them here, before they go into encoder.
*/
- nb_frames = FFMIN(nb_frames, ost->max_frames - ost->frame_number);
+ nb_frames = FFMIN(nb_frames, ost->max_frames - ost->vsync_frame_number);
nb0_frames = FFMIN(nb0_frames, nb_frames);
memmove(ost->last_nb0_frames + 1,
@@ -1237,7 +1237,7 @@ static void do_video_out(OutputFile *of,
nb_frames_drop++;
av_log(NULL, AV_LOG_VERBOSE,
"*** dropping frame %"PRId64" from stream %d at ts %"PRId64"\n",
- ost->frame_number, ost->st->index, ost->last_frame->pts);
+ ost->vsync_frame_number, ost->st->index, ost->last_frame->pts);
}
if (nb_frames > (nb0_frames && ost->last_dropped) + (nb_frames > nb0_frames)) {
if (nb_frames > dts_error_threshold * 30) {
@@ -1331,7 +1331,7 @@ static void do_video_out(OutputFile *of,
exit_program(1);
ost->sync_opts++;
- ost->frame_number++;
+ ost->vsync_frame_number++;
}
av_frame_unref(ost->last_frame);