mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 20:05:38 +00:00
rtsp: Write as much as possible in gst_rtsp_source_dispatch().
Try to write as much as possible if there are multiple messages queued.
This commit is contained in:
parent
e5ec74c7a9
commit
01d98fdb5d
1 changed files with 10 additions and 8 deletions
|
@ -3060,7 +3060,7 @@ gst_rtsp_source_dispatch (GSource * source, GSourceFunc callback G_GNUC_UNUSED,
|
|||
res = write_bytes (watch->writefd.fd, watch->write_data,
|
||||
&watch->write_off, watch->write_size);
|
||||
if (res == GST_RTSP_EINTR)
|
||||
break;
|
||||
goto write_blocked;
|
||||
else if (G_LIKELY (res == GST_RTSP_OK)) {
|
||||
if (watch->funcs.message_sent)
|
||||
watch->funcs.message_sent (watch, watch->write_id, watch->user_data);
|
||||
|
@ -3072,17 +3072,19 @@ gst_rtsp_source_dispatch (GSource * source, GSourceFunc callback G_GNUC_UNUSED,
|
|||
goto error;
|
||||
}
|
||||
|
||||
done:
|
||||
if (g_async_queue_length (watch->messages) == 0 && watch->write_added) {
|
||||
g_source_remove_poll ((GSource *) watch, &watch->writefd);
|
||||
watch->write_added = FALSE;
|
||||
watch->writefd.revents = 0;
|
||||
}
|
||||
g_free (watch->write_data);
|
||||
watch->write_data = NULL;
|
||||
} while (FALSE);
|
||||
} while (TRUE);
|
||||
|
||||
done:
|
||||
if (watch->write_added) {
|
||||
g_source_remove_poll ((GSource *) watch, &watch->writefd);
|
||||
watch->write_added = FALSE;
|
||||
watch->writefd.revents = 0;
|
||||
}
|
||||
}
|
||||
|
||||
write_blocked:
|
||||
return TRUE;
|
||||
|
||||
/* ERRORS */
|
||||
|
|
Loading…
Reference in a new issue