rtp: Random seq number at the beginning of the session

Reviewed-by: Anton Lundin <glance@acc.umu.se>
This commit is contained in:
Martin Blanchard 2016-01-31 22:16:04 -06:00 committed by Tanu Kaskinen
parent a0199dd99d
commit 60a1c27517

View file

@ -41,6 +41,7 @@
#include <pulsecore/strbuf.h> #include <pulsecore/strbuf.h>
#include <pulsecore/ioline.h> #include <pulsecore/ioline.h>
#include <pulsecore/arpa-inet.h> #include <pulsecore/arpa-inet.h>
#include <pulsecore/random.h>
#include "rtsp_client.h" #include "rtsp_client.h"
@ -199,7 +200,7 @@ static void line_callback(pa_ioline *line, const char *s, void *userdata) {
} }
if (c->waiting) { if (c->waiting) {
pa_log_warn("Unexpected response: %s", s2); pa_log_warn("Unexpected response: %s", s2);
goto exit;; goto exit;
} }
if (!strlen(s2)) { if (!strlen(s2)) {
/* End of headers */ /* End of headers */
@ -504,8 +505,8 @@ int pa_rtsp_record(pa_rtsp_client *c, uint16_t *seq, uint32_t *rtptime) {
return -1; return -1;
} }
/* Todo: Generate these values randomly as per spec */ pa_random(seq, sizeof(*seq));
*seq = *rtptime = 0; pa_random(rtptime, sizeof(*rtptime));
headers = pa_headerlist_new(); headers = pa_headerlist_new();
pa_headerlist_puts(headers, "Range", "npt=0-"); pa_headerlist_puts(headers, "Range", "npt=0-");