mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
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.
This commit is contained in:
parent
9196be2fb1
commit
2ef50c17ab
@ -2157,17 +2157,17 @@ static int fg_output_step(OutputFilterPriv *ofp, int flush)
|
|||||||
|
|
||||||
ret = av_buffersink_get_frame_flags(filter, frame,
|
ret = av_buffersink_get_frame_flags(filter, frame,
|
||||||
AV_BUFFERSINK_FLAG_NO_REQUEST);
|
AV_BUFFERSINK_FLAG_NO_REQUEST);
|
||||||
if (ret < 0) {
|
if (flush && ret == AVERROR_EOF && ofp->got_frame &&
|
||||||
if (ret != AVERROR(EAGAIN) && ret != AVERROR_EOF) {
|
ost->type == AVMEDIA_TYPE_VIDEO) {
|
||||||
av_log(fgp, AV_LOG_WARNING,
|
ret = fg_output_frame(ofp, NULL);
|
||||||
"Error in av_buffersink_get_frame_flags(): %s\n", av_err2str(ret));
|
return (ret < 0) ? ret : 1;
|
||||||
} else if (flush && ret == AVERROR_EOF && ofp->got_frame &&
|
} else if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) {
|
||||||
av_buffersink_get_type(filter) == AVMEDIA_TYPE_VIDEO) {
|
|
||||||
ret = fg_output_frame(ofp, NULL);
|
|
||||||
return (ret < 0) ? ret : 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
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) {
|
if (ost->finished) {
|
||||||
av_frame_unref(frame);
|
av_frame_unref(frame);
|
||||||
|
Loading…
Reference in New Issue
Block a user