These should be considered serious errors - don't just print a log message and continue as if nothing happened.
Unified · Split
| @@ -2157,17 +2157,17 @@ static int fg_output_step(OutputFilterPriv *ofp, int flush) · 2156 unmodified lines | ||
| 2157 | 2157 | |
| 2158 | 2158 | ret = av_buffersink_get_frame_flags(filter, frame, |
| 2159 | 2159 | AV_BUFFERSINK_FLAG_NO_REQUEST); |
| 2160 | − if (ret < 0) { | |
| 2161 | − if (ret != AVERROR(EAGAIN) && ret != AVERROR_EOF) { | |
| 2162 | − av_log(fgp, AV_LOG_WARNING, | |
| 2163 | − "Error in av_buffersink_get_frame_flags(): %s\n", av_err2str(ret)); | |
| 2164 | − } else if (flush && ret == AVERROR_EOF && ofp->got_frame && | |
| 2165 | − av_buffersink_get_type(filter) == AVMEDIA_TYPE_VIDEO) { | |
| 2166 | − ret = fg_output_frame(ofp, NULL); | |
| 2167 | − return (ret < 0) ? ret : 1; | |
| 2168 | − } | |
| 2169 | − | |
| 2160 | + if (flush && ret == AVERROR_EOF && ofp->got_frame && | |
| 2161 | + ost->type == AVMEDIA_TYPE_VIDEO) { | |
| 2162 | + ret = fg_output_frame(ofp, NULL); | |
| 2163 | + return (ret < 0) ? ret : 1; | |
| 2164 | + } else if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) { | |
| 2170 | 2165 | return 1; |
| 2166 | + } else if (ret < 0) { | |
| 2167 | + av_log(fgp, AV_LOG_WARNING, | |
| 2168 | + "Error in retrieving a frame from the filtergraph: %s\n", | |
| 2169 | + av_err2str(ret)); | |
| 2170 | + return ret; | |
| 2171 | 2171 | } |
| 2172 | 2172 | if (ost->finished) { |
| 2173 | 2173 | av_frame_unref(frame); |