[FFmpeg-cvslog] [ffmpeg-radio] 03/14: avradio/sdrdemux: Fix seeking to stations at the edge of the range
Michael Niedermayer
ffmpeg-git at ffmpeg.org
Sat Jul 22 16:55:49 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 ec21dd22b46cb242ac7e59d7e98de4e243c24a3c
Author: Michael Niedermayer <michael at niedermayer.cc>
AuthorDate: Tue Jul 18 00:23:57 2023 +0200
Commit: Michael Niedermayer <michael at niedermayer.cc>
CommitDate: Tue Jul 18 18:43:23 2023 +0200
avradio/sdrdemux: Fix seeking to stations at the edge of the range
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
libavradio/sdrdemux.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavradio/sdrdemux.c b/libavradio/sdrdemux.c
index 6b1553b130..ca0a9c5cf9 100644
--- a/libavradio/sdrdemux.c
+++ b/libavradio/sdrdemux.c
@@ -1322,6 +1322,7 @@ static int snap2station(SDRContext *sdr, int *seek_direction) {
av_assert0(!best_station || best_station != sst->station);
if (best_station) {
+ int64_t wanted_freq = av_clip64(lrint(best_station->frequency + 213*1000), sdr->min_center_freq, sdr->max_center_freq); // We target a bit off teh exact frequency to avoid artifacts
int ret = setup_stream(sdr, sdr->single_ch_audio_st_index, best_station);
if (ret < 0) {
av_log(avfmt, AV_LOG_DEBUG, "setup_stream failed\n");
@@ -1331,7 +1332,7 @@ static int snap2station(SDRContext *sdr, int *seek_direction) {
pthread_mutex_lock(&sdr->mutex);
*seek_direction =
sdr->seek_direction = 0;
- sdr->wanted_freq = lrint(best_station->frequency + 213*1000); // We target a bit off teh exact frequency to avoid artifacts
+ sdr->wanted_freq = wanted_freq;
//200*1000 had artifacts
av_log(avfmt, AV_LOG_DEBUG, "request f = %"PRId64"\n", sdr->wanted_freq);
More information about the ffmpeg-cvslog
mailing list