diff mbox series

[FFmpeg-devel,03/14] avradio/sdrdemux: require better timeout for replacing station

Message ID 20230712233706.449054-3-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,01/14] avradio/rds: reset station timeout on successfull group decode | expand

Checks

Context Check Description
andriy/configure_x86 warning Failed to apply patch
yinshiyou/configure_loongarch64 warning Failed to apply patch

Commit Message

Michael Niedermayer July 12, 2023, 11:36 p.m. UTC
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavradio/sdrdemux.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavradio/sdrdemux.c b/libavradio/sdrdemux.c
index 2103feaca8..fea4202709 100644
--- a/libavradio/sdrdemux.c
+++ b/libavradio/sdrdemux.c
@@ -216,7 +216,8 @@  static int create_station(SDRContext *sdr, Station *candidate_station) {
         }
     }
     if (best_station) {
-        if (score > best_station->score && conflict == INT_MAX) {
+        if (score > best_station->score && conflict == INT_MAX &&
+            candidate_station->timeout < best_station->timeout) {
             int log_level = fabs(best_station->frequency - freq) < 3.0 ? AV_LOG_DEBUG : AV_LOG_WARNING;
             av_log(sdr->avfmt, log_level, "Update station score:%f -> %f freq: %f %f -> %f\n",
                     best_station->score, score,