History

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.

Anton Khirnov committed 3 years ago

Commit 2ef50c11 parent 9196be21 file · +10 −10Browse files

Unified · Split

fftools/ffmpeg_filter.c+10−10
@@ -2157,17 +2157,17 @@ static int fg_output_step(OutputFilterPriv *ofp, int flush) · 2156 unmodified lines
2157 2157
2158 ret = av_buffersink_get_frame_flags(filter, frame,2158 ret = av_buffersink_get_frame_flags(filter, frame,
2159 AV_BUFFERSINK_FLAG_NO_REQUEST);2159 AV_BUFFERSINK_FLAG_NO_REQUEST);
2160 if (ret < 0) {2160 if (flush && ret == AVERROR_EOF && ofp->got_frame &&
2161 if (ret != AVERROR(EAGAIN) && ret != AVERROR_EOF) {2161 ost->type == AVMEDIA_TYPE_VIDEO) {
2162 av_log(fgp, AV_LOG_WARNING,2162 ret = fg_output_frame(ofp, NULL);
2163 "Error in av_buffersink_get_frame_flags(): %s\n", av_err2str(ret));2163 return (ret < 0) ? ret : 1;
2164 } else if (flush && ret == AVERROR_EOF && ofp->got_frame &&2164 } else if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) {
2165 av_buffersink_get_type(filter) == AVMEDIA_TYPE_VIDEO) {
2166 ret = fg_output_frame(ofp, NULL);
2167 return (ret < 0) ? ret : 1;
2168 }
2169
2170 return 1;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 if (ost->finished) {2172 if (ost->finished) {
2173 av_frame_unref(frame);2173 av_frame_unref(frame);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t