summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2016-05-20 15:22:35 +0200
committerEdward Hervey <bilboed@bilboed.com>2016-05-30 12:13:03 +0200
commitd7adf5a4f46661bcb914d29f88872759f27edbf8 (patch)
treed6115744dcd1af81c1bb16f0431bdbbca3c1f9b0
parent590522801ce2b461913801ed9a4b527d0e8b6be3 (diff)
deinterlace: Ensure DISCONT flag is properly propagated
The output of deinterlace at startup, or when receiving a new DISCONT buffer, should have the DISCONT flag set on the first buffer.
-rw-r--r--gst/deinterlace/gstdeinterlace.c11
-rw-r--r--gst/deinterlace/gstdeinterlace.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/gst/deinterlace/gstdeinterlace.c b/gst/deinterlace/gstdeinterlace.c
index cd9b1e1a5..3a1833edd 100644
--- a/gst/deinterlace/gstdeinterlace.c
+++ b/gst/deinterlace/gstdeinterlace.c
@@ -832,6 +832,8 @@ gst_deinterlace_reset (GstDeinterlace * self)
self->need_more = FALSE;
self->have_eos = FALSE;
+ self->discont = TRUE;
+
gst_deinterlace_set_allocation (self, NULL, NULL, NULL);
}
@@ -1638,6 +1640,10 @@ restart:
GST_TIME_ARGS (GST_BUFFER_DURATION (field1_buffer)),
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (field1_buffer) +
GST_BUFFER_DURATION (field1_buffer)));
+ if (self->discont) {
+ GST_BUFFER_FLAG_SET (field1_buffer, GST_BUFFER_FLAG_DISCONT);
+ self->discont = FALSE;
+ }
return gst_pad_push (self->srcpad, field1_buffer);
} else if (IS_TELECINE (interlacing_mode)
&& GST_VIDEO_FRAME_IS_INTERLACED (field1->frame) && !same_buffer) {
@@ -1805,6 +1811,10 @@ restart:
GST_TIME_ARGS (GST_BUFFER_DURATION (outbuf)),
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (outbuf) +
GST_BUFFER_DURATION (outbuf)));
+ if (self->discont) {
+ GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
+ self->discont = FALSE;
+ }
ret = gst_pad_push (self->srcpad, outbuf);
} else {
ret = GST_FLOW_OK;
@@ -2067,6 +2077,7 @@ gst_deinterlace_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
if (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DISCONT)) {
GST_DEBUG_OBJECT (self, "DISCONT buffer, resetting history");
gst_deinterlace_reset_history (self, FALSE);
+ self->discont = TRUE;
}
gst_deinterlace_push_history (self, buf);
diff --git a/gst/deinterlace/gstdeinterlace.h b/gst/deinterlace/gstdeinterlace.h
index eb8e37f7b..a8cc637d3 100644
--- a/gst/deinterlace/gstdeinterlace.h
+++ b/gst/deinterlace/gstdeinterlace.h
@@ -141,6 +141,7 @@ struct _GstDeinterlace
GstAllocationParams params;
gboolean passthrough;
+ gboolean discont;
GstClockTime field_duration; /* Duration of one field */