mirror of
https://git.videolan.org/git/ffmpeg.git
synced 2024-10-05 01:51:53 +02:00
yadif: Flush filter on eof.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
parent
7dd56d411e
commit
394a0267ab
@ -61,6 +61,7 @@ typedef struct {
|
|||||||
int w, int prefs, int mrefs, int parity, int mode);
|
int w, int prefs, int mrefs, int parity, int mode);
|
||||||
|
|
||||||
const AVPixFmtDescriptor *csp;
|
const AVPixFmtDescriptor *csp;
|
||||||
|
int eof;
|
||||||
} YADIFContext;
|
} YADIFContext;
|
||||||
|
|
||||||
#define CHECK(j)\
|
#define CHECK(j)\
|
||||||
@ -304,8 +305,21 @@ static int request_frame(AVFilterLink *link)
|
|||||||
do {
|
do {
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if ((ret = avfilter_request_frame(link->src->inputs[0])))
|
if (yadif->eof)
|
||||||
|
return AVERROR_EOF;
|
||||||
|
|
||||||
|
ret = avfilter_request_frame(link->src->inputs[0]);
|
||||||
|
|
||||||
|
if (ret == AVERROR_EOF && yadif->next) {
|
||||||
|
AVFilterBufferRef *next = avfilter_ref_buffer(yadif->next, AV_PERM_READ);
|
||||||
|
next->pts = yadif->next->pts * 2 - yadif->cur->pts;
|
||||||
|
|
||||||
|
start_frame(link->src->inputs[0], next);
|
||||||
|
end_frame(link->src->inputs[0]);
|
||||||
|
yadif->eof = 1;
|
||||||
|
} else if (ret < 0) {
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
} while (!yadif->cur);
|
} while (!yadif->cur);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user