aboutsummaryrefslogtreecommitdiffstats
path: root/fftools/ffmpeg_enc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-06-03 10:08:44 +0200
committerAnton Khirnov <anton@khirnov.net>2023-06-19 09:48:55 +0200
commita934392db048c51b1f3d0f93319ebe351c872ed3 (patch)
treef9f57f2da839ffbbbe0f555c342a4d79470f9c69 /fftools/ffmpeg_enc.c
parent1adad44fc783615cd13c83c7d08218bf3d9f2419 (diff)
downloadffmpeg-a934392db048c51b1f3d0f93319ebe351c872ed3.tar.gz
fftools/ffmpeg_enc: move dup_warning global variable to Encoder
Diffstat (limited to 'fftools/ffmpeg_enc.c')
-rw-r--r--fftools/ffmpeg_enc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c
index 2bf4782a9f..0fdf7e7c4d 100644
--- a/fftools/ffmpeg_enc.c
+++ b/fftools/ffmpeg_enc.c
@@ -66,11 +66,11 @@ struct Encoder {
// number of packets received from the encoder
uint64_t packets_encoded;
+ uint64_t dup_warning;
+
int opened;
};
-static uint64_t dup_warning = 1000;
-
void enc_free(Encoder **penc)
{
Encoder *enc = *penc;
@@ -106,6 +106,8 @@ int enc_alloc(Encoder **penc, const AVCodec *codec)
if (!enc->pkt)
goto fail;
+ enc->dup_warning = 1000;
+
*penc = enc;
return 0;
@@ -1070,9 +1072,9 @@ static void do_video_out(OutputFile *of, OutputStream *ost, AVFrame *frame)
}
ost->nb_frames_dup += nb_frames - (nb_frames_prev && ost->last_dropped) - (nb_frames > nb_frames_prev);
av_log(ost, AV_LOG_VERBOSE, "*** %"PRId64" dup!\n", nb_frames - 1);
- if (ost->nb_frames_dup > dup_warning) {
- av_log(ost, AV_LOG_WARNING, "More than %"PRIu64" frames duplicated\n", dup_warning);
- dup_warning *= 10;
+ if (ost->nb_frames_dup > e->dup_warning) {
+ av_log(ost, AV_LOG_WARNING, "More than %"PRIu64" frames duplicated\n", e->dup_warning);
+ e->dup_warning *= 10;
}
}
ost->last_dropped = nb_frames == nb_frames_prev && frame;