fftools/ffmpeg_filter: only flush vsync code if encoding actually started

Otherwise this has no effect.

Will be useful in following commits.
This commit is contained in:
Anton Khirnov 2023-07-07 09:29:58 +02:00
parent 0a6751a78a
commit b295ec31f3
1 changed files with 4 additions and 4 deletions

View File

@ -1754,10 +1754,10 @@ int reap_filters(int flush)
if (ret != AVERROR(EAGAIN) && ret != AVERROR_EOF) {
av_log(fgp, AV_LOG_WARNING,
"Error in av_buffersink_get_frame_flags(): %s\n", av_err2str(ret));
} else if (flush && ret == AVERROR_EOF) {
if (av_buffersink_get_type(filter) == AVMEDIA_TYPE_VIDEO)
enc_frame(ost, NULL);
}
} else if (flush && ret == AVERROR_EOF && ofp->got_frame &&
av_buffersink_get_type(filter) == AVMEDIA_TYPE_VIDEO)
enc_frame(ost, NULL);
break;
}
if (ost->finished) {