From b27d93a84a3f7c2474c91479a5554de0fa1b1a29 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Tue, 30 Nov 2010 15:28:50 -0800 Subject: [PATCH] deinterlace: analyse RFF fields in correct order Code was repeating the second field, not the first. Fixes: #636179. --- gst/deinterlace/gstdeinterlace.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/gst/deinterlace/gstdeinterlace.c b/gst/deinterlace/gstdeinterlace.c index d27c851..7d235e4 100644 --- a/gst/deinterlace/gstdeinterlace.c +++ b/gst/deinterlace/gstdeinterlace.c @@ -840,22 +840,25 @@ gst_deinterlace_push_history (GstDeinterlace * self, GstBuffer * buffer) timestamp = GST_BUFFER_TIMESTAMP (buffer); GST_BUFFER_TIMESTAMP (field1) = timestamp; GST_BUFFER_TIMESTAMP (field2) = timestamp + self->field_duration; - if (repeated) - GST_BUFFER_TIMESTAMP (field2) += self->field_duration; if (repeated) { - self->field_history[0].buf = field2; - self->field_history[0].flags = field2_flags; - self->field_history[1].buf = gst_buffer_ref (field1); - GST_BUFFER_TIMESTAMP (self->field_history[1].buf) += self->field_duration; - self->field_history[1].flags = field1_flags; self->field_history[2].buf = field1; self->field_history[2].flags = field1_flags; + + self->field_history[1].buf = field2; + self->field_history[1].flags = field2_flags; + + self->field_history[0].buf = + gst_buffer_make_metadata_writable (gst_buffer_ref (field1)); + GST_BUFFER_TIMESTAMP (self->field_history[0].buf) += + 2 * self->field_duration; + self->field_history[0].flags = field1_flags; } else if (!onefield) { - self->field_history[0].buf = field2; - self->field_history[0].flags = field2_flags; self->field_history[1].buf = field1; self->field_history[1].flags = field1_flags; + + self->field_history[0].buf = field2; + self->field_history[0].flags = field2_flags; } else { /* onefield */ self->field_history[0].buf = field1; self->field_history[0].flags = field1_flags; -- 2.7.4