rtspsrc: Use a mutex for protecting against concurrent send/receives
authorSebastian Dröge <sebastian@centricular.com>
Thu, 15 Jun 2017 07:40:51 +0000 (10:40 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Sat, 17 Jun 2017 07:51:46 +0000 (10:51 +0300)
commit4c7fad2dba108e5d6413579a23041445ae7df469
tree5622871414c287a0f4428321575e4e23bca4cab1
parent0421fb04470af90e8810e7e5e69955d3192896ba
rtspsrc: Use a mutex for protecting against concurrent send/receives

We currently send data to the RTSP connection from multiple threads:
whenever a command is to be handled and whenever RTCP is generated. This
can cause data corruption or worse if both happen at the same time.

As such, protect gst_rtsp_connection_send() and gst_rtsp_connection_receive()
calls with a mutex. While this means that we hold a mutex during the IO
operation, this is not actually a problem as the IO operation can be
interrupted (gst_rtsp_connection_flush()) at any time and is blocking by
itself anyway.
gst/rtsp/gstrtspsrc.c
gst/rtsp/gstrtspsrc.h