rtmp2: Avoid a deadlock when getting stats
authorJan Alexander Steffens (heftig) <jsteffens@make.tv>
Wed, 8 Apr 2020 16:39:06 +0000 (18:39 +0200)
committerJan Alexander Steffens (heftig) <jsteffens@make.tv>
Wed, 8 Apr 2020 16:41:01 +0000 (18:41 +0200)
commit6680b70781ebaafd2ce49db766b6012678b450eb
tree81fd8863c7d930e39c8251ebeb67b6ee6ab3c360
parentbe8cec5348783df9f20e0aad8ba499224d3203a2
rtmp2: Avoid a deadlock when getting stats

We need to do this without holding the lock as the `g_async_queue_pop`
waits on the loop thread to deliver the stats. The loop thread might
attempt to take the lock as well, leading to a deadlock.

Taking a reference to the connection should be enough to keep this
safe.
gst/rtmp2/gstrtmp2sink.c
gst/rtmp2/gstrtmp2src.c