diff --git a/sys/decklink/gstdecklink.cpp b/sys/decklink/gstdecklink.cpp index b51f64ba28..3f3b0a77d9 100644 --- a/sys/decklink/gstdecklink.cpp +++ b/sys/decklink/gstdecklink.cpp @@ -235,6 +235,7 @@ struct _GstDecklinkClockClass }; GType gst_decklink_clock_get_type (void); +static GstClock * gst_decklink_clock_new (const gchar * name); typedef struct _Device Device; struct _Device @@ -419,9 +420,7 @@ init_devices (gpointer data) GST_WARNING ("selected device does not have input interface"); } else { devices[i].input.device = decklink; - devices[i].input.clock = - GST_CLOCK_CAST (g_object_new (GST_TYPE_DECKLINK_CLOCK, "name", - "GstDecklinkInputClock", NULL)); + devices[i].input.clock = gst_decklink_clock_new ("GstDecklinkInputClock"); GST_DECKLINK_CLOCK_CAST (devices[i].input.clock)->input = devices[i].input.input; devices[i].input. @@ -435,9 +434,7 @@ init_devices (gpointer data) GST_WARNING ("selected device does not have output interface"); } else { devices[i].output.device = decklink; - devices[i].output.clock = - GST_CLOCK_CAST (g_object_new (GST_TYPE_DECKLINK_CLOCK, "name", - "GstDecklinkOutputClock", NULL)); + devices[i].output.clock = gst_decklink_clock_new ("GstDecklinkOutputClock"); GST_DECKLINK_CLOCK_CAST (devices[i].output.clock)->output = devices[i].output.output; } @@ -605,9 +602,6 @@ gst_decklink_release_nth_input (gint n, GstElement * src, gboolean is_audio) G_DEFINE_TYPE (GstDecklinkClock, gst_decklink_clock, GST_TYPE_SYSTEM_CLOCK); -static void gst_decklink_clock_class_init (GstDecklinkClockClass * klass); -static void gst_decklink_clock_init (GstDecklinkClock * clock); - static GstClockTime gst_decklink_clock_get_internal_time (GstClock * clock); static void @@ -624,14 +618,14 @@ gst_decklink_clock_init (GstDecklinkClock * clock) GST_OBJECT_FLAG_SET (clock, GST_CLOCK_FLAG_CAN_SET_MASTER); } -GstDecklinkClock * +static GstClock * gst_decklink_clock_new (const gchar * name) { GstDecklinkClock *self = GST_DECKLINK_CLOCK (g_object_new (GST_TYPE_DECKLINK_CLOCK, "name", name, "clock-type", GST_CLOCK_TYPE_OTHER, NULL)); - return self; + return GST_CLOCK_CAST (self); } static GstClockTime diff --git a/sys/decklink/gstdecklinkaudiosrc.cpp b/sys/decklink/gstdecklinkaudiosrc.cpp index 7661892501..4cfc2475af 100644 --- a/sys/decklink/gstdecklinkaudiosrc.cpp +++ b/sys/decklink/gstdecklinkaudiosrc.cpp @@ -405,12 +405,12 @@ gst_decklink_audio_src_create (GstPushSrc * bsrc, GstBuffer ** buffer) // Convert to the sample numbers end_offset = gst_util_uint64_scale (end_time, self->info.rate, GST_SECOND); - if (end_offset >= sample_count) + if (end_offset >= (guint64) sample_count) start_offset = end_offset - sample_count; else start_offset = 0; - if (self->next_offset == -1) { + if (self->next_offset == (guint64) -1) { discont = TRUE; } else { guint64 diff, max_sample_diff; @@ -445,7 +445,7 @@ gst_decklink_audio_src_create (GstPushSrc * bsrc, GstBuffer ** buffer) if (discont) { // Have discont, need resync and use the capture timestamps - if (self->next_offset != -1) + if (self->next_offset != (guint64) -1) GST_INFO_OBJECT (self, "Have discont. Expected %" G_GUINT64_FORMAT ", got %" G_GUINT64_FORMAT, self->next_offset, start_offset); diff --git a/sys/decklink/gstdecklinkaudiosrc.h b/sys/decklink/gstdecklinkaudiosrc.h index 55248b55e8..2391a10fec 100644 --- a/sys/decklink/gstdecklinkaudiosrc.h +++ b/sys/decklink/gstdecklinkaudiosrc.h @@ -66,7 +66,7 @@ struct _GstDecklinkAudioSrc GstClockTime discont_wait; /* counter to keep track of timestamps */ - gint64 next_offset; + guint64 next_offset; /* Last time we noticed a discont */ GstClockTime discont_time;