aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2013-06-02 11:30:52 +0200
committerNicolas George <nicolas.george@normalesup.org>2013-06-02 23:19:42 +0200
commitfc82f4a1f8aadca2f22e9029d610402c8a68fe9c (patch)
tree3335c9920561f9e9b5aee1908f0cccaee492e7b3 /ffmpeg.c
parent582f36ca3fb1c69dbe3478f174d36278f5dd3f63 (diff)
downloadffmpeg-fc82f4a1f8aadca2f22e9029d610402c8a68fe9c.tar.gz
ffmpeg: ignore EOF when pushing frames to filters.
EOF is not a fatal condition, it is normally produced by a few filters. TODO: take it into account to avoid useless decoding.
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 886039b485..c9ac577dd2 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1623,6 +1623,8 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output)
f = decoded_frame;
err = av_buffersrc_add_frame_flags(ist->filters[i]->filter, f,
AV_BUFFERSRC_FLAG_PUSH);
+ if (err == AVERROR_EOF)
+ err = 0; /* ignore */
if (err < 0)
break;
}
@@ -1726,7 +1728,9 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
} else
f = decoded_frame;
ret = av_buffersrc_add_frame_flags(ist->filters[i]->filter, f, AV_BUFFERSRC_FLAG_PUSH);
- if (ret < 0) {
+ if (ret == AVERROR_EOF) {
+ ret = 0; /* ignore */
+ } else if (ret < 0) {
av_log(NULL, AV_LOG_FATAL,
"Failed to inject frame into filter network: %s\n", av_err2str(ret));
exit(1);