diff mbox series

[FFmpeg-devel,v3,4/6] avformat/rtspdec: cosmetics

Message ID 20201012203609.41647-4-andriy.gelman@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel,v3,1/6] avformat/rtspdec: add network init to listen mode
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished

Commit Message

Andriy Gelman Oct. 12, 2020, 8:36 p.m. UTC
From: Andriy Gelman <andriy.gelman@gmail.com>

Make error check style consistent with rest of function.
---
 libavformat/rtspdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Martin Storsjö Nov. 20, 2020, 8:25 a.m. UTC | #1
On Mon, 12 Oct 2020, Andriy Gelman wrote:

> From: Andriy Gelman <andriy.gelman@gmail.com>
>
> Make error check style consistent with rest of function.
> ---
> libavformat/rtspdec.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
> index 7c617837ca..b9fbc45190 100644
> --- a/libavformat/rtspdec.c
> +++ b/libavformat/rtspdec.c
> @@ -744,9 +744,9 @@ static int rtsp_read_header(AVFormatContext *s)
>         if (rt->initial_pause) {
>             /* do not start immediately */
>         } else {
> -            if ((ret = rtsp_read_play(s)) < 0) {
> +            ret = rtsp_read_play(s);
> +            if (ret < 0)
>                 goto fail;
> -            }
>         }
>     }
> 
> -- 
> 2.28.0

If you feel that way, and that's the common style around it (I would tend 
to remember that a lot of code there uses the terse form, which has its 
pros and cons), it's probably ok, especially if you've taken the time to 
want to change it...

// Martin
diff mbox series

Patch

diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index 7c617837ca..b9fbc45190 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -744,9 +744,9 @@  static int rtsp_read_header(AVFormatContext *s)
         if (rt->initial_pause) {
             /* do not start immediately */
         } else {
-            if ((ret = rtsp_read_play(s)) < 0) {
+            ret = rtsp_read_play(s);
+            if (ret < 0)
                 goto fail;
-            }
         }
     }