summaryrefslogtreecommitdiff
path: root/libavfilter/yadif_common.c
diff options
context:
space:
mode:
authorDevin Heitmueller <devin.heitmueller@ltnglobal.com>2023-05-05 15:09:04 -0400
committerLimin Wang <lance.lmwang@gmail.com>2023-05-11 22:06:20 +0800
commitcecf35ae3e997dd884295d692aa6829462394132 (patch)
treea5740c36e21fc6827a531e68bc05251cbe77a681 /libavfilter/yadif_common.c
parent61a9f3c0ce7f74ba869f44a49e16f3cd1b79e18d (diff)
downloadffmpeg-cecf35ae3e997dd884295d692aa6829462394132.tar.gz
avfilter/yadif: Properly preserve CEA-708 closed captions
Various deinterlacing modes have the effect of doubling the framerate, and we need to ensure that the caption data isn't duplicated (or else you get double captions on-screen). Use the new ccfifo mechanism for yadif (and yadif_cuda and bwdif since they use the same yadif core) so that CEA-708 data is properly preserved through this filter. Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libavfilter/yadif_common.c')
-rw-r--r--libavfilter/yadif_common.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavfilter/yadif_common.c b/libavfilter/yadif_common.c
index 2bd6111140..49ea7cfce4 100644
--- a/libavfilter/yadif_common.c
+++ b/libavfilter/yadif_common.c
@@ -65,6 +65,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
yadif->out->pts = AV_NOPTS_VALUE;
}
}
+
+ ff_ccfifo_inject(yadif->cc_fifo, yadif->out);
ret = ff_filter_frame(ctx->outputs[0], yadif->out);
yadif->frame_pending = (yadif->mode&1) && !is_second;
@@ -101,6 +103,8 @@ int ff_yadif_filter_frame(AVFilterLink *link, AVFrame *frame)
av_assert0(frame);
+ ff_ccfifo_extract(yadif->cc_fifo, frame);
+
if (yadif->frame_pending)
return_frame(ctx, 1);
@@ -142,6 +146,7 @@ int ff_yadif_filter_frame(AVFilterLink *link, AVFrame *frame)
if (!yadif->out)
return AVERROR(ENOMEM);
+ ff_ccfifo_inject(yadif->cc_fifo, yadif->out);
av_frame_free(&yadif->prev);
if (yadif->out->pts != AV_NOPTS_VALUE)
yadif->out->pts *= 2;