From patchwork Tue Jul 18 21:45:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 42814 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:b813:b0:130:ccc6:6c4b with SMTP id fi19csp781590pzb; Tue, 18 Jul 2023 14:46:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlF5ZxHWzZrzKys6YXzVNC6SkIborf7j+x/7gvVN654j9+s/WkJJM2u2COm9ynf2OpzKEoD0 X-Received: by 2002:a17:906:4546:b0:992:d013:1131 with SMTP id s6-20020a170906454600b00992d0131131mr800754ejq.52.1689716789629; Tue, 18 Jul 2023 14:46:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689716789; cv=none; d=google.com; s=arc-20160816; b=MNgk3kmYsD3rAbVyBSSh2nZwgpXiPyzkAnUM4Q/4sa4K0XASrguARZ9IZyTMV2/PRt kCUrOfmHLVNt9Bueyy2cbKT/luENNxk9+AFDwCXfPl5zmF5x1CaIy+mi4lsIs7qqY3nu L1nIJTzniV+PCyhKmva+gfB3O0vdMOgJDJqFAFl2KaLkeFMjkrXtbs9uU4DP0iSH+ml7 4chRi/2Eqerz8UttL7iC0YezPJTIY5iKu3Lf9F2qRIkJ624Z/nTrtBI8XK4iBADAH/1p i5CC+4LgV/5C1k51DWuAzlP3PIUw+bDYCImVbz6tbPqpb1ZM9v2N6VboYsMl7+lIB1zk CGyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=IDrG8LXuwRSZAAZHQmoFyW2cgbxk4zN1pvkPNa77p34=; fh=YYwLYmpaV0Fpw/rxmSKNRLS2XzDkAlGbHATiKOPtZrY=; b=fcJ+VOMjTwtgbhPBPDFX5iKILrYUGJph6KTomrN9XztZ6V8r9Q+IepHadQJgSlWDz+ V0nGZsaWEiQSCdPFc+QHEyzdFGyWdpOu2r/f7fDZVVMoZsxAbE2aZjwKjq97DGW+R1cl h6lGmiyam/UhNKD5PQRqgTJOs4OS4uItefXobIpJPa6XQKjxTEvricuYhx0yt6Db+5sZ hwxVolDhUstINpLnvqXkuOje16LOxgjNuKUBl7DCE0krroPpO4FVmPyoEyZFKhd0igIz MR38k9sMvhl9gfGAchUBjf6uG02L1V3X1T1BBbPFYxtW+hDdew1E74NGglKldauqGhQv oP1w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id dx14-20020a170906a84e00b0099331b3e6f2si1697784ejb.663.2023.07.18.14.46.29; Tue, 18 Jul 2023 14:46:29 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 522E068C5AA; Wed, 19 Jul 2023 00:45:57 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AB8EF68C4BE for ; Wed, 19 Jul 2023 00:45:48 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id E5567E0002 for ; Tue, 18 Jul 2023 21:45:47 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 18 Jul 2023 23:45:33 +0200 Message-Id: <20230718214542.685375-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230718214542.685375-1-michael@niedermayer.cc> References: <20230718214542.685375-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 05/14] avradio/sdr: snap2station() documentation X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: hBRPP0z6P063 Signed-off-by: Michael Niedermayer --- libavradio/sdrdemux.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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];