diff mbox

[FFmpeg-devel,1/2] rtsp: Use AVERROR() with errno.h error codes for error returns

Message ID 20191211122123.31156-1-martin@martin.st
State Accepted
Commit 29f8d4e9477ccab7d52eef4f15c00b56286d7551
Headers show

Commit Message

Martin Storsjö Dec. 11, 2019, 12:21 p.m. UTC
For this particular function, it's only required to return nonzero,
but use the common AVERROR() pattern for consistency.
---
 libavformat/rtsp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer Dec. 12, 2019, 8:57 a.m. UTC | #1
On Wed, Dec 11, 2019 at 02:21:22PM +0200, Martin Storsjö wrote:
> For this particular function, it's only required to return nonzero,
> but use the common AVERROR() pattern for consistency.
> ---
>  libavformat/rtsp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

LGTM

thx

[...]
diff mbox

Patch

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 859defa592..cd6fc32a29 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1319,7 +1319,7 @@  static int rtsp_send_cmd_with_content_async(AVFormatContext *s,
     char base64buf[AV_BASE64_SIZE(sizeof(buf))];
 
     if (!rt->rtsp_hd_out)
-        return ENOTCONN;
+        return AVERROR(ENOTCONN);
 
     /* Add in RTSP headers */
     out_buf = buf;