[FFmpeg-devel] lavc/opusenc_psy: Remove a write-only variable

Submitted by Carl Eugen Hoyos on Jan. 4, 2018, 4:38 a.m.

Details

Message ID CAB0OVGqj4+x-miF6U4+S9LJb6a3ukothE0JE+bf4LyObE5Cnkg@mail.gmail.com
State Rejected
Headers show

Commit Message

Carl Eugen Hoyos Jan. 4, 2018, 4:38 a.m.
Hi!

Attached patch fixes a warning here when compiling the opus encoder.

Please comment, Carl Eugen

Comments

Jun Zhao Jan. 5, 2018, 1:49 a.m.
On 2018/1/4 12:38, Carl Eugen Hoyos wrote:
> Hi!
>
> Attached patch fixes a warning here when compiling the opus encoder.
>
> Please comment, Carl Eugen
LGTM
>
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Rostislav Pehlivanov Jan. 5, 2018, 2:24 a.m.
On 4 January 2018 at 04:38, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:

> Hi!
>
> Attached patch fixes a warning here when compiling the opus encoder.
>
> Please comment, Carl Eugen
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
Whatever compiler is printing out that warning, tell them its annoying and
it should shut up

I don't like this patch and I'm planning on using that variable in the
future.
Jun Zhao Jan. 5, 2018, 2:38 a.m.
On 2018/1/5 10:24, Rostislav Pehlivanov wrote:
> On 4 January 2018 at 04:38, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
>
>> Hi!
>>
>> Attached patch fixes a warning here when compiling the opus encoder.
>>
>> Please comment, Carl Eugen
>>
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>>
> Whatever compiler is printing out that warning, tell them its annoying and
> it should shut up
>
> I don't like this patch and I'm planning on using that variable in the
> future.
If you want keep the variable, it's need to split the declarations and
code to clean
the build warning like "warning: ISO C90 forbids mixed declarations and
code"
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Patch hide | download patch | download mbox

From 605194d85651b76586c8f14cf8034a266e9fc8fd Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Thu, 4 Jan 2018 05:36:38 +0100
Subject: [PATCH] lavc/opusenc_psy: Remove a write-only variable.

Fixes a warning:
libavcodec/opusenc_psy.c:407:5: warning: ISO C90 forbids mixed declarations and code
---
 libavcodec/opusenc_psy.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavcodec/opusenc_psy.c b/libavcodec/opusenc_psy.c
index b712603..622f15c 100644
--- a/libavcodec/opusenc_psy.c
+++ b/libavcodec/opusenc_psy.c
@@ -404,9 +404,7 @@  static void celt_search_for_intensity(OpusPsyContext *s, CeltFrame *f)
         return;
 
     /* TODO: fix, make some heuristic up here using the lambda value */
-    float end_band = 0;
-
-    for (i = f->end_band; i >= end_band; i--) {
+    for (i = f->end_band; i >= 0; i--) {
         f->intensity_stereo = i;
         bands_dist(s, f, &dist);
         if (best_dist > dist) {
-- 
1.7.10.4