diff mbox series

[FFmpeg-devel,05/14] avradio/sdr: snap2station() documentation

Message ID 20230718214542.685375-5-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,01/14] avradio/sdrdemux: Add Mittelwelle / Mediumwave / Mediumfrequency band | 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 18, 2023, 9:45 p.m. UTC
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavradio/sdrdemux.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/libavradio/sdrdemux.c b/libavradio/sdrdemux.c
index f189c85a0d..07b43dec1c 100644
--- a/libavradio/sdrdemux.c
+++ b/libavradio/sdrdemux.c
@@ -1287,6 +1287,16 @@  static int sdrfile_read_callback(SDRContext *sdr, FIFOElement *fifo_element, int
     return ret;
 }
 
+/**
+ * switch to the closest station in view and the provided seek_direction.
+ *
+ * This function is scanning friendly, it will not consider stations not in
+ * view and rather wait for a future invocation when they are in view
+ *
+ * when a station is found, this will move to it and stop scanning if needed
+ *
+ * @return 1 if a station is found, 0 if not, or a negative error code on error
+ */
 static int snap2station(SDRContext *sdr, int *seek_direction) {
     AVFormatContext *avfmt = sdr->avfmt;
     AVStream *st = avfmt->streams[sdr->single_ch_audio_st_index];