diff options
-rw-r--r-- | audio/filter/af_lavfi.c | 6 | ||||
-rw-r--r-- | video/filter/vf_lavfi.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/audio/filter/af_lavfi.c b/audio/filter/af_lavfi.c index bc4a687487..c072fdcb9a 100644 --- a/audio/filter/af_lavfi.c +++ b/audio/filter/af_lavfi.c @@ -266,6 +266,12 @@ static int filter_frame(struct af_instance *af, struct mp_audio *data) if (!p->graph) goto error; + if (!data) { + if (p->eof) + return 0; + p->eof = true; + } + if (data) { frame = mp_audio_to_avframe_and_unref(data); data = NULL; diff --git a/video/filter/vf_lavfi.c b/video/filter/vf_lavfi.c index a66bd2a971..6c18f829c4 100644 --- a/video/filter/vf_lavfi.c +++ b/video/filter/vf_lavfi.c @@ -298,6 +298,12 @@ static int filter_ext(struct vf_instance *vf, struct mp_image *mpi) if (!p->graph) return -1; + if (!mpi) { + if (p->eof) + return 0; + p->eof = true; + } + AVFrame *frame = mp_to_av(vf, mpi); int r = av_buffersrc_add_frame(p->in, frame) < 0 ? -1 : 0; av_frame_free(&frame); |