summaryrefslogtreecommitdiff
path: root/libavformat/rtmpproto.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2012-05-24 13:48:42 +0200
committerMartin Storsjö <martin@martin.st>2012-05-24 22:16:46 +0300
commit177bcc9593a5f43ccf0697b9c7a1caa5935686b7 (patch)
tree3c474bb176265a772ceeef9ac19746b7d6c20c68 /libavformat/rtmpproto.c
parentbba287fdac98362e94f386159912046b8b1a65fc (diff)
downloadffmpeg-177bcc9593a5f43ccf0697b9c7a1caa5935686b7.tar.gz
rtmp: Pass the proper return code in rtmp_handshake
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/rtmpproto.c')
-rw-r--r--libavformat/rtmpproto.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index 1f78d1c322..9af4584226 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",