[libav-commits] rtmp: Pass the proper return code in rtmp_handshake

Samuel Pitoiset git at libav.org
Thu May 24 23:06:16 CEST 2012


Module: libav
Branch: master
Commit: 177bcc9593a5f43ccf0697b9c7a1caa5935686b7

Author:    Samuel Pitoiset <samuel.pitoiset at gmail.com>
Committer: Martin Storsjö <martin at martin.st>
Date:      Thu May 24 13:48:42 2012 +0200

rtmp: Pass the proper return code in rtmp_handshake

Signed-off-by: Martin Storsjö <martin at martin.st>

---

 libavformat/rtmpproto.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index 1f78d1c..9af4584 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -639,15 +639,16 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
         return ret;
     }
 
-    i = ffurl_read_complete(rt->stream, serverdata, RTMP_HANDSHAKE_PACKET_SIZE + 1);
-    if (i != RTMP_HANDSHAKE_PACKET_SIZE + 1) {
+    if ((ret = ffurl_read_complete(rt->stream, serverdata,
+                                   RTMP_HANDSHAKE_PACKET_SIZE + 1)) < 0) {
         av_log(s, AV_LOG_ERROR, "Cannot read RTMP handshake response\n");
-        return AVERROR(EIO);
+        return ret;
     }
-    i = ffurl_read_complete(rt->stream, clientdata, RTMP_HANDSHAKE_PACKET_SIZE);
-    if (i != RTMP_HANDSHAKE_PACKET_SIZE) {
+
+    if ((ret = ffurl_read_complete(rt->stream, clientdata,
+                                   RTMP_HANDSHAKE_PACKET_SIZE)) < 0) {
         av_log(s, AV_LOG_ERROR, "Cannot read RTMP handshake response\n");
-        return AVERROR(EIO);
+        return ret;
     }
 
     av_log(s, AV_LOG_DEBUG, "Server version %d.%d.%d.%d\n",



More information about the libav-commits mailing list