diff options
author | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2012-05-23 18:55:52 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2012-05-24 00:25:36 +0300 |
commit | a4d3f3580bd993f4e8f4abc9c4ad486cb1c51987 (patch) | |
tree | 053c2a8a1476ac215c27c20b6fdadb51c729e141 | |
parent | 08e93f5b46c8ddb5939e6f2a47c19c2c152772c3 (diff) | |
download | ffmpeg-a4d3f3580bd993f4e8f4abc9c4ad486cb1c51987.tar.gz |
rtmp: Return a proper error code instead of -1
Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r-- | libavformat/rtmpproto.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index d00f44af27..31cc194dcb 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -621,12 +621,12 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt) i = ffurl_read_complete(rt->stream, serverdata, RTMP_HANDSHAKE_PACKET_SIZE + 1); if (i != RTMP_HANDSHAKE_PACKET_SIZE + 1) { av_log(s, AV_LOG_ERROR, "Cannot read RTMP handshake response\n"); - return -1; + return AVERROR(EIO); } i = ffurl_read_complete(rt->stream, clientdata, RTMP_HANDSHAKE_PACKET_SIZE); if (i != RTMP_HANDSHAKE_PACKET_SIZE) { av_log(s, AV_LOG_ERROR, "Cannot read RTMP handshake response\n"); - return -1; + return AVERROR(EIO); } av_log(s, AV_LOG_DEBUG, "Server version %d.%d.%d.%d\n", @@ -644,7 +644,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt) if (!server_pos) { av_log(s, AV_LOG_ERROR, "Server response validating failed\n"); - return -1; + return AVERROR(EIO); } } @@ -660,7 +660,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt) if (memcmp(digest, clientdata + RTMP_HANDSHAKE_PACKET_SIZE - 32, 32)) { av_log(s, AV_LOG_ERROR, "Signature mismatch\n"); - return -1; + return AVERROR(EIO); } for (i = 0; i < RTMP_HANDSHAKE_PACKET_SIZE; i++) |