0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00

Don't drop last rdt packet on eof

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21860 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
rtogni 2007-01-09 21:32:25 +00:00
parent ba8331d618
commit 34a57f0ec5
3 changed files with 9 additions and 2 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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);