Commit 4c7fad2d authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

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.
parent 0421fb04
This diff is collapsed.
......@@ -86,6 +86,9 @@ struct _GstRTSPConnInfo {
GstRTSPConnection *connection;
gboolean connected;
gboolean flushing;
GMutex send_lock;
GMutex recv_lock;
};
typedef struct _GstRTSPStream GstRTSPStream;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment