mirror of
https://git.videolan.org/git/ffmpeg.git
synced 2024-09-18 12:37:46 +02:00
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.
This commit is contained in:
parent
582f36ca3f
commit
fc82f4a1f8
6
ffmpeg.c
6
ffmpeg.c
@ -1623,6 +1623,8 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output)
|
|||||||
f = decoded_frame;
|
f = decoded_frame;
|
||||||
err = av_buffersrc_add_frame_flags(ist->filters[i]->filter, f,
|
err = av_buffersrc_add_frame_flags(ist->filters[i]->filter, f,
|
||||||
AV_BUFFERSRC_FLAG_PUSH);
|
AV_BUFFERSRC_FLAG_PUSH);
|
||||||
|
if (err == AVERROR_EOF)
|
||||||
|
err = 0; /* ignore */
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1726,7 +1728,9 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
|
|||||||
} else
|
} else
|
||||||
f = decoded_frame;
|
f = decoded_frame;
|
||||||
ret = av_buffersrc_add_frame_flags(ist->filters[i]->filter, f, AV_BUFFERSRC_FLAG_PUSH);
|
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,
|
av_log(NULL, AV_LOG_FATAL,
|
||||||
"Failed to inject frame into filter network: %s\n", av_err2str(ret));
|
"Failed to inject frame into filter network: %s\n", av_err2str(ret));
|
||||||
exit(1);
|
exit(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user