diff options
Diffstat (limited to 'src/input/librtsp/rtsp_session.c')
-rw-r--r-- | src/input/librtsp/rtsp_session.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/input/librtsp/rtsp_session.c b/src/input/librtsp/rtsp_session.c index 88103aa7d..2ae002662 100644 --- a/src/input/librtsp/rtsp_session.c +++ b/src/input/librtsp/rtsp_session.c @@ -89,7 +89,7 @@ rtsp_session_t *rtsp_session_start(xine_stream_t *stream, char *mrl) { rmff_header_t *h; int bandwidth_id; uint32_t bandwidth; - + bandwidth_id = xine->config->register_enum(xine->config, "media.network.bandwidth", 10, (char **)rtsp_bandwidth_strs, _("network bandwidth"), @@ -100,7 +100,7 @@ rtsp_session_t *rtsp_session_start(xine_stream_t *stream, char *mrl) { bandwidth = rtsp_bandwidths[bandwidth_id]; rtsp_session->recv = xine_buffer_init(BUF_SIZE); - + connect: /* connect to server */ @@ -149,8 +149,8 @@ connect: return NULL; } } - - rtsp_session->header_left = + + rtsp_session->header_left = rtsp_session->header_len = rmff_dump_header(h,rtsp_session->header,HEADER_SIZE); if (rtsp_session->header_len < 0) { xprintf (stream->xine, XINE_VERBOSITY_LOG, @@ -161,7 +161,7 @@ connect: xine_buffer_copyin(rtsp_session->recv, 0, rtsp_session->header, rtsp_session->header_len); rtsp_session->recv_size = rtsp_session->header_len; rtsp_session->recv_read = 0; - + } else { xprintf(stream->xine, XINE_VERBOSITY_LOG, @@ -174,29 +174,29 @@ connect: return NULL; } free(server); - + return rtsp_session; } void rtsp_session_set_start_time (rtsp_session_t *this, int start_time) { - + if (start_time >= 0) this->start_time = start_time; } static void rtsp_session_play (rtsp_session_t *this) { - + char buf[256]; - - snprintf (buf, sizeof(buf), "Range: npt=%d.%03d-", + + snprintf (buf, sizeof(buf), "Range: npt=%d.%03d-", this->start_time/1000, this->start_time%1000); - + rtsp_schedule_field (this->s, buf); rtsp_request_play (this->s,NULL); } int rtsp_session_read (rtsp_session_t *this, char *data, int len) { - + int to_copy; char *dest=data; char *source=this->recv + this->recv_read; @@ -204,22 +204,22 @@ int rtsp_session_read (rtsp_session_t *this, char *data, int len) { if (len < 0) return 0; - + if (this->header_left) { if (len > this->header_left) len = this->header_left; - + this->header_left -= len; } - + to_copy = len; while (to_copy > fill) { - + if (!this->playing) { rtsp_session_play (this); this->playing = 1; } - + memcpy(dest, source, fill); to_copy -= fill; dest += fill; @@ -234,7 +234,7 @@ int rtsp_session_read (rtsp_session_t *this, char *data, int len) { return len-to_copy; } } - + memcpy(dest, source, to_copy); this->recv_read += to_copy; |