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

Otherwise this has no effect.

Will be useful in following commits.
pull/389/head
Anton Khirnov 1 year ago
parent 0a6751a78a
commit b295ec31f3
  1. 8
      fftools/ffmpeg_filter.c

@ -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) {

Loading…
Cancel
Save