[FFmpeg-cvslog] [ffmpeg-radio] 04/13: avradio/avformat/sdrdemux: only update agc_gain on success

Michael Niedermayer ffmpeg-git at ffmpeg.org
Sat Sep 16 21:38:20 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 3186d0dde0ed71f4edd7e9d0461072efebba7372
Author:     Michael Niedermayer <michael at niedermayer.cc>
AuthorDate: Fri Jul 28 19:36:32 2023 +0200
Commit:     Michael Niedermayer <michael at niedermayer.cc>
CommitDate: Sun Jul 30 23:11:35 2023 +0200

    avradio/avformat/sdrdemux: only update agc_gain on success
    
    Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavformat/sdrdemux.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/sdrdemux.c b/libavformat/sdrdemux.c
index e5ee4e80f5..fa45d30a3d 100644
--- a/libavformat/sdrdemux.c
+++ b/libavformat/sdrdemux.c
@@ -1533,8 +1533,10 @@ static void *soapy_needs_bigger_buffers_worker(SDRContext *sdr)
             fabs(wanted_gain - agc_gain) > 0.001 &&
             sdr->set_gain_callback
         ) {
-            sdr->set_gain_callback(sdr, wanted_gain);
-            agc_gain = wanted_gain;
+            int ret = sdr->set_gain_callback(sdr, wanted_gain);
+            if (ret >= 0) {
+                agc_gain = wanted_gain;
+            }
         }
         pthread_mutex_unlock(&sdr->mutex);
 



More information about the ffmpeg-cvslog mailing list