Mercurial > libavformat.hg
comparison rtsp.c @ 6410:31aef55204bd libavformat
rtsp: Return EOF if the TCP control channel is closed
author | mstorsjo |
---|---|
date | Wed, 25 Aug 2010 13:42:17 +0000 |
parents | f8c3cb8c503e |
children | f0669792a6bd |
comparison
equal
deleted
inserted
replaced
6409:fe8fadaf5fb6 | 6410:31aef55204bd |
---|---|
795 ret = url_read_complete(rt->rtsp_hd, &ch, 1); | 795 ret = url_read_complete(rt->rtsp_hd, &ch, 1); |
796 #ifdef DEBUG_RTP_TCP | 796 #ifdef DEBUG_RTP_TCP |
797 dprintf(s, "ret=%d c=%02x [%c]\n", ret, ch, ch); | 797 dprintf(s, "ret=%d c=%02x [%c]\n", ret, ch, ch); |
798 #endif | 798 #endif |
799 if (ret != 1) | 799 if (ret != 1) |
800 return -1; | 800 return AVERROR_EOF; |
801 if (ch == '\n') | 801 if (ch == '\n') |
802 break; | 802 break; |
803 if (ch == '$') { | 803 if (ch == '$') { |
804 /* XXX: only parse it if first char on line ? */ | 804 /* XXX: only parse it if first char on line ? */ |
805 if (return_on_interleaved_data) { | 805 if (return_on_interleaved_data) { |
1717 redo: | 1717 redo: |
1718 for (;;) { | 1718 for (;;) { |
1719 RTSPMessageHeader reply; | 1719 RTSPMessageHeader reply; |
1720 | 1720 |
1721 ret = ff_rtsp_read_reply(s, &reply, NULL, 1); | 1721 ret = ff_rtsp_read_reply(s, &reply, NULL, 1); |
1722 if (ret == -1) | 1722 if (ret < 0) |
1723 return -1; | 1723 return ret; |
1724 if (ret == 1) /* received '$' */ | 1724 if (ret == 1) /* received '$' */ |
1725 break; | 1725 break; |
1726 /* XXX: parse message */ | 1726 /* XXX: parse message */ |
1727 if (rt->state != RTSP_STATE_STREAMING) | 1727 if (rt->state != RTSP_STATE_STREAMING) |
1728 return 0; | 1728 return 0; |