[FFmpeg-cvslog] [ffmpeg-radio] 06/13: avradio/avformat/sdrdemux: run clip check on the correct samples

Michael Niedermayer ffmpeg-git at ffmpeg.org
Sat Sep 16 21:38:22 EEST 2023


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

Git pushed a commit to branch master
in repository libavradio.

commit 030e19056127b6d9ca33d9ad626bd117538ab1b0
Author:     Michael Niedermayer <michael at niedermayer.cc>
AuthorDate: Sat Jul 29 16:01:10 2023 +0200
Commit:     Michael Niedermayer <michael at niedermayer.cc>
CommitDate: Sun Jul 30 23:11:42 2023 +0200

    avradio/avformat/sdrdemux: run clip check on the correct samples
    
    Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavformat/sdrdemux.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/libavformat/sdrdemux.c b/libavformat/sdrdemux.c
index 44a6489bd2..69349add7b 100644
--- a/libavformat/sdrdemux.c
+++ b/libavformat/sdrdemux.c
@@ -1153,10 +1153,9 @@ static int demodulate_fm(SDRContext *sdr, Station *station, AVStream *st, AVPack
             sst->out_buf[2*i+0] =
             sst->out_buf[2*i+1] = m;
         }
-
-        if (fabs(sst->out_buf[i]) > clip) {
-            av_log(sdr->avfmt, AV_LOG_WARNING, "CLIP %f\n", sst->out_buf[i]);
-            clip = fabs(sst->out_buf[i]) * 1.1;
+        if (fmax(fabs(sst->out_buf[2*i+0]), fabs(sst->out_buf[2*i+1])) > clip) {
+            av_log(sdr->avfmt, AV_LOG_WARNING, "CLIP %f %f\n", sst->out_buf[2*i+0], sst->out_buf[2*i+1]);
+            clip = fmax(fabs(sst->out_buf[2*i+0]), fabs(sst->out_buf[2*i+1])) * 1.1;
         }
     }
 



More information about the ffmpeg-cvslog mailing list