rtmp2: Only grab stats on close when connection exists

If the connection attempt failed, self->connection is NULL.
This commit is contained in:
Jan Alexander Steffens (heftig) 2020-03-03 10:49:08 +01:00 committed by GStreamer Merge Bot
parent 3e2d86ea18
commit e83888302d
2 changed files with 6 additions and 2 deletions

View file

@ -911,7 +911,9 @@ gst_rtmp2_sink_task_func (gpointer user_data)
g_main_loop_run (loop);
g_mutex_lock (&self->lock);
self->stats = gst_rtmp_connection_get_stats (self->connection);
if (self->connection) {
self->stats = gst_rtmp_connection_get_stats (self->connection);
}
g_clear_pointer (&self->loop, g_main_loop_unref);
g_clear_pointer (&self->connection, gst_rtmp_connection_close_and_unref);

View file

@ -646,7 +646,9 @@ gst_rtmp2_src_task_func (gpointer user_data)
g_main_loop_run (loop);
g_mutex_lock (&self->lock);
self->stats = gst_rtmp_connection_get_stats (self->connection);
if (self->connection) {
self->stats = gst_rtmp_connection_get_stats (self->connection);
}
g_clear_pointer (&self->loop, g_main_loop_unref);
g_clear_pointer (&self->connection, gst_rtmp_connection_close_and_unref);