summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorrtogni <rtogni@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-01-09 21:32:25 +0000
committerrtogni <rtogni@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-01-09 21:32:25 +0000
commit34a57f0ec5b6a1abe6be2a36118dd7cc0ee334da (patch)
tree3c9f4af930f61b24d20ab7dd8278b10f402c5438 /stream
parentba8331d618f76d65480b113e537758ede381e630 (diff)
downloadmpv-34a57f0ec5b6a1abe6be2a36118dd7cc0ee334da.tar.bz2
mpv-34a57f0ec5b6a1abe6be2a36118dd7cc0ee334da.tar.xz
Don't drop last rdt packet on eof
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21860 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/librtsp/rtsp_session.c8
-rw-r--r--stream/realrtsp/real.c1
-rw-r--r--stream/realrtsp/real.h2
3 files changed, 9 insertions, 2 deletions
diff --git a/stream/librtsp/rtsp_session.c b/stream/librtsp/rtsp_session.c
index 8aaace4a01..a5c6655cf5 100644
--- a/stream/librtsp/rtsp_session.c
+++ b/stream/librtsp/rtsp_session.c
@@ -208,6 +208,8 @@ int rtsp_session_read (rtsp_session_t *this, char *data, int len) {
(char *) (this->real_session->recv + this->real_session->recv_read);
int fill = this->real_session->recv_size - this->real_session->recv_read;
+ if(this->real_session->rdteof)
+ return -1;
if (len < 0) return 0;
if (this->real_session->recv_size < 0) return -1;
while (to_copy > fill) {
@@ -218,8 +220,10 @@ int rtsp_session_read (rtsp_session_t *this, char *data, int len) {
this->real_session->recv_read = 0;
this->real_session->recv_size =
real_get_rdt_chunk (this->s, (char **)&(this->real_session->recv));
- if (this->real_session->recv_size < 0)
- return -1;
+ if (this->real_session->recv_size < 0) {
+ this->real_session->rdteof = 1;
+ this->real_session->recv_size = 0;
+ }
source = (char *) this->real_session->recv;
fill = this->real_session->recv_size;
diff --git a/stream/realrtsp/real.c b/stream/realrtsp/real.c
index 3ad4fa9a7f..99f203a3a6 100644
--- a/stream/realrtsp/real.c
+++ b/stream/realrtsp/real.c
@@ -649,6 +649,7 @@ init_real_rtsp_session (void)
real_rtsp_session = malloc (sizeof (struct real_rtsp_session_t));
real_rtsp_session->recv = xbuffer_init (BUF_SIZE);
+ real_rtsp_session->rdteof = 0;
return real_rtsp_session;
}
diff --git a/stream/realrtsp/real.h b/stream/realrtsp/real.h
index 447bb30de9..4abc58cbd1 100644
--- a/stream/realrtsp/real.h
+++ b/stream/realrtsp/real.h
@@ -45,6 +45,8 @@ struct real_rtsp_session_t {
uint8_t header[HEADER_SIZE];
int header_len;
int header_read;
+
+ int rdteof;
};
int real_get_rdt_chunk(rtsp_t *rtsp_session, char **buffer);