mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 11:32:38 +00:00
stream: don't leak stats structure
Don't leak the stats structure and deal with NULL stats.
This commit is contained in:
parent
7edaa6ca20
commit
036f2760bf
1 changed files with 13 additions and 0 deletions
|
@ -1889,6 +1889,9 @@ gst_rtsp_stream_get_rtpinfo (GstRTSPStream * stream,
|
|||
|
||||
g_object_get (priv->payloader, "stats", &stats, NULL);
|
||||
|
||||
if (stats == NULL)
|
||||
goto no_stats;
|
||||
|
||||
if (seq)
|
||||
gst_structure_get_uint (stats, "seqnum", seq);
|
||||
|
||||
|
@ -1904,9 +1907,19 @@ gst_rtsp_stream_get_rtpinfo (GstRTSPStream * stream,
|
|||
*running_time = GST_CLOCK_TIME_NONE;
|
||||
}
|
||||
|
||||
gst_structure_free (stats);
|
||||
|
||||
g_mutex_unlock (&priv->lock);
|
||||
|
||||
return TRUE;
|
||||
|
||||
/* ERRORS */
|
||||
no_stats:
|
||||
{
|
||||
GST_WARNING ("Could not get payloader stats");
|
||||
g_mutex_unlock (&priv->lock);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue