changeset 13676:929af3b49c8e

EOF detection (fix hanging at end of stream)
author rtognimp
date Mon, 18 Oct 2004 20:08:12 +0000
parents d4cba4c4c54c
children 2e8b1e13b8c3
files libmpdemux/realrtsp/real.c libmpdemux/realrtsp/rtsp_session.c
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/realrtsp/real.c	Mon Oct 18 20:00:07 2004 +0000
+++ b/libmpdemux/realrtsp/real.c	Mon Oct 18 20:08:12 2004 +0000
@@ -618,6 +618,10 @@
 #ifdef LOG
     printf("got flags1: 0x%02x\n",flags1);
 #endif
+    if(header[6] == 0x06) {
+      printf("Stream EOF detected\n");
+      return -1;
+    }
     header[0]=header[5];
     header[1]=header[6];
     header[2]=header[7];
--- a/libmpdemux/realrtsp/rtsp_session.c	Mon Oct 18 20:00:07 2004 +0000
+++ b/libmpdemux/realrtsp/rtsp_session.c	Mon Oct 18 20:08:12 2004 +0000
@@ -169,6 +169,8 @@
     dest += fill;
     this->recv_read = 0;
     this->recv_size = real_get_rdt_chunk (this->s, (char **)&(this->recv));
+    if (this->recv_size < 0)
+      return -1;
     source = this->recv;
     fill = this->recv_size;