diff options
author | Anton Khirnov <anton@khirnov.net> | 2023-09-12 11:58:12 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-10-10 12:41:31 +0200 |
commit | 2ef50c17ab5aff95fc5372b6041c6fc835cac62b (patch) | |
tree | 0a614f9925478267728966f11be86ff3deac4c98 /fftools/ffmpeg_filter.c | |
parent | 9196be2fb10ad5c15c644a1fbb01f59f25b72cc9 (diff) | |
download | ffmpeg-2ef50c17ab5aff95fc5372b6041c6fc835cac62b.tar.gz |
fftools/ffmpeg_filter: fail on filtering errors
These should be considered serious errors - don't just print a log
message and continue as if nothing happened.
Diffstat (limited to 'fftools/ffmpeg_filter.c')
-rw-r--r-- | fftools/ffmpeg_filter.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 7d0a720fe1..c738fc3397 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -2157,17 +2157,17 @@ static int fg_output_step(OutputFilterPriv *ofp, int flush) ret = av_buffersink_get_frame_flags(filter, frame, AV_BUFFERSINK_FLAG_NO_REQUEST); - if (ret < 0) { - 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 && ofp->got_frame && - av_buffersink_get_type(filter) == AVMEDIA_TYPE_VIDEO) { - ret = fg_output_frame(ofp, NULL); - return (ret < 0) ? ret : 1; - } - + if (flush && ret == AVERROR_EOF && ofp->got_frame && + ost->type == AVMEDIA_TYPE_VIDEO) { + ret = fg_output_frame(ofp, NULL); + return (ret < 0) ? ret : 1; + } else if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) { return 1; + } else if (ret < 0) { + av_log(fgp, AV_LOG_WARNING, + "Error in retrieving a frame from the filtergraph: %s\n", + av_err2str(ret)); + return ret; } if (ost->finished) { av_frame_unref(frame); |