This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 728655e2e7665e9059778953797a98dc6bb9d145
Author:     Ayoub Nabil Boubagrat 
<[email protected]>
AuthorDate: Fri Aug 28 11:53:43 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Mon Aug 31 13:42:52 2026 +0000

    avfilter/aphaser: clip integer output
    
    Signed-off-by: Ayoub Nabil Boubagrat 
<[email protected]>
---
 libavfilter/af_aphaser.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/libavfilter/af_aphaser.c b/libavfilter/af_aphaser.c
index 8d7f624827..81535d6b28 100644
--- a/libavfilter/af_aphaser.c
+++ b/libavfilter/af_aphaser.c
@@ -86,7 +86,7 @@ static av_cold int init(AVFilterContext *ctx)
 
 #define MOD(a, b) (((a) >= (b)) ? (a) - (b) : (a))
 
-#define PHASER_PLANAR(name, type)                                      \
+#define PHASER_PLANAR(name, type, output)                              \
 static void phaser_## name ##p(AudioPhaserContext *s,                  \
                                uint8_t * const *ssrc, uint8_t **ddst,  \
                                int nb_samples, int channels)           \
@@ -114,7 +114,7 @@ static void phaser_## name ##p(AudioPhaserContext *s,       
           \
             delay_pos = MOD(delay_pos + 1, s->delay_buffer_length);    \
             buffer[delay_pos] = v;                                     \
                                                                        \
-            *dst = v * s->out_gain;                                    \
+            *dst = output;                                             \
         }                                                              \
     }                                                                  \
                                                                        \
@@ -122,7 +122,7 @@ static void phaser_## name ##p(AudioPhaserContext *s,       
           \
     s->modulation_pos = modulation_pos;                                \
 }
 
-#define PHASER(name, type)                                              \
+#define PHASER(name, type, output)                                      \
 static void phaser_## name (AudioPhaserContext *s,                      \
                             uint8_t * const *ssrc, uint8_t **ddst,      \
                             int nb_samples, int channels)               \
@@ -147,7 +147,7 @@ static void phaser_## name (AudioPhaserContext *s,          
            \
                                                                         \
             buffer[npos + c] = v;                                       \
                                                                         \
-            *dst = v * s->out_gain;                                     \
+            *dst = output;                                              \
         }                                                               \
                                                                         \
         modulation_pos = MOD(modulation_pos + 1,                        \
@@ -158,15 +158,15 @@ static void phaser_## name (AudioPhaserContext *s,        
              \
     s->modulation_pos = modulation_pos;                                 \
 }
 
-PHASER_PLANAR(dbl, double)
-PHASER_PLANAR(flt, float)
-PHASER_PLANAR(s16, int16_t)
-PHASER_PLANAR(s32, int32_t)
+PHASER_PLANAR(dbl, double,  v * s->out_gain)
+PHASER_PLANAR(flt, float,   v * s->out_gain)
+PHASER_PLANAR(s16, int16_t, av_clipd(v * s->out_gain, INT16_MIN, INT16_MAX))
+PHASER_PLANAR(s32, int32_t, av_clipd(v * s->out_gain, INT32_MIN, INT32_MAX))
 
-PHASER(dbl, double)
-PHASER(flt, float)
-PHASER(s16, int16_t)
-PHASER(s32, int32_t)
+PHASER(dbl, double,  v * s->out_gain)
+PHASER(flt, float,   v * s->out_gain)
+PHASER(s16, int16_t, av_clipd(v * s->out_gain, INT16_MIN, INT16_MAX))
+PHASER(s32, int32_t, av_clipd(v * s->out_gain, INT32_MIN, INT32_MAX))
 
 static int config_output(AVFilterLink *outlink)
 {

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to