Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GstLAL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lscsoft
GstLAL
Commits
a1e936c0
Commit
a1e936c0
authored
15 years ago
by
Kipp Cannon
Browse files
Options
Downloads
Patches
Plain Diff
add some missing error handling code
parent
3e388f71
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/gstlal_triggergen.c
+21
-13
21 additions, 13 deletions
src/plugins/gstlal_triggergen.c
with
21 additions
and
13 deletions
src/plugins/gstlal_triggergen.c
+
21
−
13
View file @
a1e936c0
...
...
@@ -251,8 +251,9 @@ static GstFlowReturn gen_collected(GstCollectPads *pads, gpointer user_data)
GstSegment
*
segment
=
gstlal_collect_pads_get_segment
(
element
->
collect
);
if
(
!
segment
)
{
/* FIXME: failure getting bounding segment, do
* something about it */
GST_ERROR_OBJECT
(
element
,
"unable to retrieve bounding segment"
);
result
=
GST_FLOW_ERROR
;
goto
error
;
}
element
->
segment
=
*
segment
;
gst_segment_free
(
segment
);
...
...
@@ -265,8 +266,9 @@ static GstFlowReturn gen_collected(GstCollectPads *pads, gpointer user_data)
event
=
gst_event_new_new_segment_full
(
FALSE
,
element
->
segment
.
rate
,
1
.
0
,
GST_FORMAT_TIME
,
element
->
segment
.
start
,
element
->
segment
.
stop
,
element
->
segment
.
start
);
if
(
!
event
)
{
/* FIXME: failure building event, do something
* about it */
GST_ERROR_OBJECT
(
element
,
"unable to create new segment event"
);
result
=
GST_FLOW_ERROR
;
goto
error
;
}
gst_pad_push_event
(
element
->
srcpad
,
event
);
...
...
@@ -333,9 +335,8 @@ static GstFlowReturn gen_collected(GstCollectPads *pads, gpointer user_data)
*/
result
=
gst_pad_alloc_buffer
(
element
->
srcpad
,
element
->
next_output_offset
,
0
,
GST_PAD_CAPS
(
element
->
srcpad
),
&
srcbuf
);
if
(
result
!=
GST_FLOW_OK
)
{
/* FIXME: handle failure */
}
if
(
result
!=
GST_FLOW_OK
)
goto
error
;
GST_BUFFER_OFFSET
(
srcbuf
)
=
GST_BUFFER_OFFSET_END
(
srcbuf
)
=
element
->
next_output_offset
;
GST_BUFFER_FLAG_SET
(
srcbuf
,
GST_BUFFER_FLAG_GAP
);
}
else
{
...
...
@@ -411,7 +412,12 @@ static GstFlowReturn gen_collected(GstCollectPads *pads, gpointer user_data)
result
=
gst_pad_alloc_buffer
(
element
->
srcpad
,
element
->
next_output_offset
,
nevents
*
sizeof
(
*
head
),
GST_PAD_CAPS
(
element
->
srcpad
),
&
srcbuf
);
if
(
result
!=
GST_FLOW_OK
)
{
/* FIXME: handle failure */
while
(
head
)
{
SnglInspiralTable
*
next
=
head
->
next
;
free
(
head
);
head
=
next
;
}
goto
error
;
}
GST_BUFFER_OFFSET
(
srcbuf
)
=
element
->
next_output_offset
;
element
->
next_output_offset
+=
nevents
;
...
...
@@ -434,9 +440,8 @@ static GstFlowReturn gen_collected(GstCollectPads *pads, gpointer user_data)
dest
[
nevents
].
next
=
NULL
;
}
else
{
result
=
gst_pad_alloc_buffer
(
element
->
srcpad
,
element
->
next_output_offset
,
0
,
GST_PAD_CAPS
(
element
->
srcpad
),
&
srcbuf
);
if
(
result
!=
GST_FLOW_OK
)
{
/* FIXME: handle failure */
}
if
(
result
!=
GST_FLOW_OK
)
goto
error
;
GST_BUFFER_OFFSET
(
srcbuf
)
=
GST_BUFFER_OFFSET_END
(
srcbuf
)
=
element
->
next_output_offset
;
GST_BUFFER_FLAG_SET
(
srcbuf
,
GST_BUFFER_FLAG_GAP
);
}
...
...
@@ -531,7 +536,8 @@ static void gen_set_property(GObject *object, enum gen_property id, const GValue
element
->
last_event
[
length
].
sigmasq
=
sigmasq
[
length
];
}
g_free
(
sigmasq
);
}
}
else
GST_WARNING_OBJECT
(
element
,
"must set template bank before setting sigmasq"
);
g_mutex_unlock
(
element
->
bank_lock
);
break
;
}
...
...
@@ -572,8 +578,10 @@ static void gen_get_property(GObject * object, enum gen_property id, GValue * va
for
(
i
=
0
;
i
<
element
->
num_templates
;
i
++
)
sigmasq
[
i
]
=
element
->
bank
[
i
].
sigmasq
;
g_value_take_boxed
(
value
,
gstlal_g_value_array_from_doubles
(
sigmasq
,
element
->
num_templates
));
}
else
}
else
{
GST_WARNING_OBJECT
(
element
,
"no template bank"
);
g_value_take_boxed
(
value
,
g_value_array_new
(
0
));
}
g_mutex_unlock
(
element
->
bank_lock
);
break
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment