summaryrefslogtreecommitdiffstats
path: root/gst/deinterlace
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-06-10 09:56:11 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-06-10 09:57:31 +0200
commitf297e37b5e8c8acacefa401a1b0ff7d3889dece7 (patch)
tree163b267dc03ab0980ca84707376baad5a105bf9b /gst/deinterlace
parentdc61a71e5d8052fc5f270fd8478c44fd3796cf99 (diff)
deinterlace: Fix QoS calculations
The diff is a signed integer, not an unsigned one of course. In modes other than GST_DEINTERLACE_ALL every frame has twice the duration of the field duration.
Diffstat (limited to 'gst/deinterlace')
-rw-r--r--gst/deinterlace/gstdeinterlace.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gst/deinterlace/gstdeinterlace.c b/gst/deinterlace/gstdeinterlace.c
index b8c2fa23..54eab67b 100644
--- a/gst/deinterlace/gstdeinterlace.c
+++ b/gst/deinterlace/gstdeinterlace.c
@@ -395,7 +395,7 @@ static const GstQueryType *gst_deinterlace_src_query_types (GstPad * pad);
static void gst_deinterlace_reset (GstDeinterlace * self);
static void gst_deinterlace_update_qos (GstDeinterlace * self,
- gdouble proportion, GstClockTime diff, GstClockTime time);
+ gdouble proportion, GstClockTimeDiff diff, GstClockTime time);
static void gst_deinterlace_reset_qos (GstDeinterlace * self);
static void gst_deinterlace_read_qos (GstDeinterlace * self,
gdouble * proportion, GstClockTime * time);
@@ -938,13 +938,16 @@ gst_deinterlace_push_history (GstDeinterlace * self, GstBuffer * buffer)
static void
gst_deinterlace_update_qos (GstDeinterlace * self, gdouble proportion,
- GstClockTime diff, GstClockTime timestamp)
+ GstClockTimeDiff diff, GstClockTime timestamp)
{
GST_OBJECT_LOCK (self);
self->proportion = proportion;
if (G_LIKELY (timestamp != GST_CLOCK_TIME_NONE)) {
if (G_UNLIKELY (diff > 0))
- self->earliest_time = timestamp + 2 * diff + self->field_duration;
+ self->earliest_time =
+ timestamp + 2 * diff + ((self->fields ==
+ GST_DEINTERLACE_ALL) ? self->field_duration : 2 *
+ self->field_duration);
else
self->earliest_time = timestamp + diff;
} else {