mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-25 16:52:31 +00:00
Merge remote-tracking branch 'cigaes/master'
* cigaes/master: lavfi/trim: mark link closed on EOF. ffmpeg: ignore EOF when pushing frames to filters. Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
2976e2a102
6
ffmpeg.c
6
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);
|
||||
|
@ -162,7 +162,7 @@ static int trim_filter_frame(AVFilterLink *inlink, AVFrame *frame)
|
||||
drop = 0;
|
||||
|
||||
if (drop) {
|
||||
s->eof = 1;
|
||||
s->eof = inlink->closed = 1;
|
||||
goto drop;
|
||||
}
|
||||
}
|
||||
@ -296,7 +296,7 @@ static int atrim_filter_frame(AVFilterLink *inlink, AVFrame *frame)
|
||||
}
|
||||
|
||||
if (drop) {
|
||||
s->eof = 1;
|
||||
s->eof = inlink->closed = 1;
|
||||
goto drop;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user