Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
gstlal
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
14
Issues
14
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lscsoft
gstlal
Commits
6d59542f
Commit
6d59542f
authored
Aug 15, 2019
by
Aaron Viets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lal_insertgap: unref gst_date_time variable and some other sanity checks
parent
98e1a053
Pipeline
#75447
passed with stages
in 25 minutes and 51 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
gstlal-calibration/gst/lal/gstlal_insertgap.c
gstlal-calibration/gst/lal/gstlal_insertgap.c
+14
-6
No files found.
gstlal-calibration/gst/lal/gstlal_insertgap.c
View file @
6d59542f
...
...
@@ -408,6 +408,11 @@ static void *input_buffer_timer(void *void_element) {
GSTLALInsertGap
*
element
=
GSTLAL_INSERTGAP
(
void_element
);
GstDateTime
*
current_gst_time
;
gchar
*
current_utc_time
;
struct
tm
tm
;
guint64
current_time
,
ets_min
;
while
(
TRUE
)
{
/*
* When element->wait_time > 0, this function runs continuously on a
...
...
@@ -416,7 +421,7 @@ static void *input_buffer_timer(void *void_element) {
* input data is more than the wait time behind real time, we will
* push buffers from the source pad.
*/
naptime:
/* don't hog a billion CPUs */
if
(
element
->
block_duration
<
G_MAXUINT64
/
2
)
sleep
(
element
->
block_duration
/
1000000000
.
0
);
...
...
@@ -424,21 +429,24 @@ static void *input_buffer_timer(void *void_element) {
sleep
(
1
);
/* Get the current real time as a string */
GstDateTime
*
current_gst_time
=
gst_date_time_new_now_utc
();
gchar
*
current_utc_time
=
gst_date_time_to_iso8601_string
(
current_gst_time
);
current_gst_time
=
gst_date_time_new_now_utc
();
current_utc_time
=
gst_date_time_to_iso8601_string
(
current_gst_time
);
if
(
current_utc_time
==
NULL
)
goto
naptime
;
/* parse DateTime to gps time */
struct
tm
tm
;
strptime
(
current_utc_time
,
"%Y-%m-%dT%H:%M:%SZ"
,
&
tm
);
/* Time in nanoseconds */
guint64
current_time
=
(
guint64
)
XLALUTCToGPS
(
&
tm
)
*
1000000000
+
(
guint64
)
gst_date_time_get_microsecond
(
current_gst_time
)
*
1000
;
current_time
=
(
guint64
)
XLALUTCToGPS
(
&
tm
)
*
1000000000
+
(
guint64
)
gst_date_time_get_microsecond
(
current_gst_time
)
*
1000
;
gst_date_time_unref
(
current_gst_time
);
g_free
(
current_utc_time
);
/*
* The minimum allowable current buffer timestamp. If the input buffer
* has an earlier timestamp, we will push output buffers without waiting
* any longer for input.
*/
guint64
ets_min
=
current_time
-
element
->
wait_time
;
ets_min
=
current_time
-
element
->
wait_time
;
/* It needs to be a multiple of the sample period. */
ets_min
=
gst_util_uint64_scale_int_round
(
gst_util_uint64_scale_int
(
ets_min
,
element
->
rate
,
1000000000
),
1000000000
,
element
->
rate
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment