g_mutex_lock (watch->mutex);
/* try to send the message synchronously first */
- if (watch->messages->length == 0) {
+ if (watch->messages->length == 0 && watch->write_data == NULL) {
- res = write_bytes (watch->writefd.fd, data, &off, size);
+ res =
+ write_bytes (watch->conn->write_socket, data, &off, size,
+ watch->conn->cancellable);
if (res != GST_RTSP_EINTR) {
if (id != NULL)
*id = 0;