You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
fftools/ffmpeg_enc: move dup_warning global variable to Encoder
This commit is contained in:
@@ -66,11 +66,11 @@ struct Encoder {
|
|||||||
// number of packets received from the encoder
|
// number of packets received from the encoder
|
||||||
uint64_t packets_encoded;
|
uint64_t packets_encoded;
|
||||||
|
|
||||||
|
uint64_t dup_warning;
|
||||||
|
|
||||||
int opened;
|
int opened;
|
||||||
};
|
};
|
||||||
|
|
||||||
static uint64_t dup_warning = 1000;
|
|
||||||
|
|
||||||
void enc_free(Encoder **penc)
|
void enc_free(Encoder **penc)
|
||||||
{
|
{
|
||||||
Encoder *enc = *penc;
|
Encoder *enc = *penc;
|
||||||
@@ -106,6 +106,8 @@ int enc_alloc(Encoder **penc, const AVCodec *codec)
|
|||||||
if (!enc->pkt)
|
if (!enc->pkt)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
enc->dup_warning = 1000;
|
||||||
|
|
||||||
*penc = enc;
|
*penc = enc;
|
||||||
|
|
||||||
return 0;
|
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);
|
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);
|
av_log(ost, AV_LOG_VERBOSE, "*** %"PRId64" dup!\n", nb_frames - 1);
|
||||||
if (ost->nb_frames_dup > dup_warning) {
|
if (ost->nb_frames_dup > e->dup_warning) {
|
||||||
av_log(ost, AV_LOG_WARNING, "More than %"PRIu64" frames duplicated\n", dup_warning);
|
av_log(ost, AV_LOG_WARNING, "More than %"PRIu64" frames duplicated\n", e->dup_warning);
|
||||||
dup_warning *= 10;
|
e->dup_warning *= 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ost->last_dropped = nb_frames == nb_frames_prev && frame;
|
ost->last_dropped = nb_frames == nb_frames_prev && frame;
|
||||||
|
Reference in New Issue
Block a user