diff mbox

[FFmpeg-devel] avcodec/opus: Add {} over multiline if() body

Message ID 20180102223457.10813-1-michael@niedermayer.cc
State New
Headers show

Commit Message

Michael Niedermayer Jan. 2, 2018, 10:34 p.m. UTC
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/opus.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Derek Buitenhuis Jan. 2, 2018, 10:39 p.m. UTC | #1
On 1/2/2018 10:34 PM, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/opus.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Looks reasonable.

- Derek
Rostislav Pehlivanov Jan. 3, 2018, 1:34 a.m. UTC | #2
On 2 January 2018 at 22:34, Michael Niedermayer <michael@niedermayer.cc>
wrote:

> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/opus.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/opus.c b/libavcodec/opus.c
> index 9cbf4aed92..d00a17a7f1 100644
> --- a/libavcodec/opus.c
> +++ b/libavcodec/opus.c
> @@ -566,12 +566,12 @@ void ff_celt_bitalloc(CeltFrame *f, OpusRangeCoder
> *rc, int encode)
>      int bits2[CELT_MAX_BANDS];
>
>      /* Spread */
> -    if (opus_rc_tell(rc) + 4 <= f->framebits)
> +    if (opus_rc_tell(rc) + 4 <= f->framebits) {
>          if (encode)
>              ff_opus_rc_enc_cdf(rc, f->spread, ff_celt_model_spread);
>          else
>              f->spread = ff_opus_rc_dec_cdf(rc, ff_celt_model_spread);
> -    else
> +    } else
>          f->spread = CELT_SPREAD_NORMAL;
>
>      /* Initialize static allocation caps */
> --
> 2.15.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

Add brackets after the } else and it'll look good to me.
Michael Niedermayer Jan. 12, 2018, 9:50 p.m. UTC | #3
On Wed, Jan 03, 2018 at 01:34:59AM +0000, Rostislav Pehlivanov wrote:
> On 2 January 2018 at 22:34, Michael Niedermayer <michael@niedermayer.cc>
> wrote:
> 
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavcodec/opus.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavcodec/opus.c b/libavcodec/opus.c
> > index 9cbf4aed92..d00a17a7f1 100644
> > --- a/libavcodec/opus.c
> > +++ b/libavcodec/opus.c
> > @@ -566,12 +566,12 @@ void ff_celt_bitalloc(CeltFrame *f, OpusRangeCoder
> > *rc, int encode)
> >      int bits2[CELT_MAX_BANDS];
> >
> >      /* Spread */
> > -    if (opus_rc_tell(rc) + 4 <= f->framebits)
> > +    if (opus_rc_tell(rc) + 4 <= f->framebits) {
> >          if (encode)
> >              ff_opus_rc_enc_cdf(rc, f->spread, ff_celt_model_spread);
> >          else
> >              f->spread = ff_opus_rc_dec_cdf(rc, ff_celt_model_spread);
> > -    else
> > +    } else
> >          f->spread = CELT_SPREAD_NORMAL;
> >
> >      /* Initialize static allocation caps */
> > --
> > 2.15.1
> >
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> 
> Add brackets after the } else and it'll look good to me.

will apply with that change

thx

[...]
diff mbox

Patch

diff --git a/libavcodec/opus.c b/libavcodec/opus.c
index 9cbf4aed92..d00a17a7f1 100644
--- a/libavcodec/opus.c
+++ b/libavcodec/opus.c
@@ -566,12 +566,12 @@  void ff_celt_bitalloc(CeltFrame *f, OpusRangeCoder *rc, int encode)
     int bits2[CELT_MAX_BANDS];
 
     /* Spread */
-    if (opus_rc_tell(rc) + 4 <= f->framebits)
+    if (opus_rc_tell(rc) + 4 <= f->framebits) {
         if (encode)
             ff_opus_rc_enc_cdf(rc, f->spread, ff_celt_model_spread);
         else
             f->spread = ff_opus_rc_dec_cdf(rc, ff_celt_model_spread);
-    else
+    } else
         f->spread = CELT_SPREAD_NORMAL;
 
     /* Initialize static allocation caps */