for AM we can find the frequency very precissely, for FM currently not so
much

Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
---
 libavradio/sdrdemux.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavradio/sdrdemux.c b/libavradio/sdrdemux.c
index 90f6805c3b..92b1e2b170 100644
--- a/libavradio/sdrdemux.c
+++ b/libavradio/sdrdemux.c
@@ -166,9 +166,10 @@ static int create_station(SDRContext *sdr, Station 
*candidate_station) {
         return best_station_index;
     }
     for (i=0; i<sdr->nb_candidate_stations; i++) {
+        int freq_precission = modulation == AM ? 5 : 50;
         double delta = fabs(sdr->candidate_station[i]->frequency - freq);
         // Station already added, or we have 2 rather close stations
-        if (modulation == sdr->candidate_station[i]->modulation && delta < 10 
&& sdr->candidate_station[i] != candidate_station) {
+        if (modulation == sdr->candidate_station[i]->modulation && delta < 
freq_precission && sdr->candidate_station[i] != candidate_station) {
             nb_candidate_match++;
         }
         if (modulation != sdr->candidate_station[i]->modulation && delta < 
(bandwidth + sdr->candidate_station[i]->bandwidth)/2.1)
-- 
2.31.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to