mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-23 14:36:24 +00:00
spanplc: Don't segfault when retrieving the stats property without a spanplc context
For example when trying to get the property value in NULL state. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1258>
This commit is contained in:
parent
2a2e48fd9e
commit
d6f6c51f3c
1 changed files with 10 additions and 8 deletions
|
@ -75,9 +75,10 @@ static gboolean gst_span_plc_event_sink (GstPad * pad, GstObject * parent,
|
||||||
static GstStructure *
|
static GstStructure *
|
||||||
gst_span_plc_create_stats (GstSpanPlc * self)
|
gst_span_plc_create_stats (GstSpanPlc * self)
|
||||||
{
|
{
|
||||||
GstStructure *s;
|
GstStructure *s = NULL;
|
||||||
|
|
||||||
GST_OBJECT_LOCK (self);
|
GST_OBJECT_LOCK (self);
|
||||||
|
if (self->plc_state) {
|
||||||
s = gst_structure_new ("application/x-spanplc-stats",
|
s = gst_structure_new ("application/x-spanplc-stats",
|
||||||
"num-pushed", G_TYPE_UINT64, self->num_pushed,
|
"num-pushed", G_TYPE_UINT64, self->num_pushed,
|
||||||
"num-gap", G_TYPE_UINT64, self->num_gap,
|
"num-gap", G_TYPE_UINT64, self->num_gap,
|
||||||
|
@ -85,6 +86,7 @@ gst_span_plc_create_stats (GstSpanPlc * self)
|
||||||
"plc-duration", G_TYPE_UINT64, self->plc_duration,
|
"plc-duration", G_TYPE_UINT64, self->plc_duration,
|
||||||
"pitch", G_TYPE_INT, self->plc_state->pitch,
|
"pitch", G_TYPE_INT, self->plc_state->pitch,
|
||||||
"pitch-offset", G_TYPE_INT, self->plc_state->pitch_offset, NULL);
|
"pitch-offset", G_TYPE_INT, self->plc_state->pitch_offset, NULL);
|
||||||
|
}
|
||||||
GST_OBJECT_UNLOCK (self);
|
GST_OBJECT_UNLOCK (self);
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
|
|
Loading…
Reference in a new issue