From patchwork Tue Jul 4 22:22:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 42438 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1e:b0:12b:9ae3:586d with SMTP id c30csp5378171pzh; Tue, 4 Jul 2023 15:23:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlG0HSLot5dswtMZP2cCVlRHL9wLz8rA00qXQyK3dFtEduNXnI2LF6G5lczKEncmWNhegIw+ X-Received: by 2002:aa7:c997:0:b0:51e:ec0:fd84 with SMTP id c23-20020aa7c997000000b0051e0ec0fd84mr5111937edt.40.1688509404335; Tue, 04 Jul 2023 15:23:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688509404; cv=none; d=google.com; s=arc-20160816; b=S1P8rz0ho+ajW4D8TYCRBd1zzLfvD3EeAzy/h8CygzJDzQnG4o/fbPaE391yvaBs1V xTGYcYZt7h5fFuMf1GkXgImYZigiuXwPeMBjrFwbJPvgFw7KyJYpiuervqT5DY2eFmoW FfbiomkFd9nba+pYaRF0xNpddB3JLFBcGf51hOcsmk99BO7VrPGZSM+emcICu4vcyYi9 z7Ft8blIRpac1xOa9VynyJuIJvhx6ahJ4T1/dShjBfFt6yLbb1rYc2pfQ31fO4t6F/mb 1/8A2xZZs9ONvaUElRNEfYiUTRF2AiTtfoXas30tcvPICT2oxELP8CoLnhVPh6mYgHBS jWxg== 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=IcDR8QrvFQg8jAzdJLfYGLrX0q69jOJAUfttPwTJJXs=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=EzndqfhOf3bKycTTAvok++njFt3i89jsdTF85kC15+2HVTNsqNLgBC1A+V7yAvatpi Eqn1Vy0T8FNRMNxlyEa4Kd1MrE7Nl4fN0S5bSRF/PIdcg1lRh2Jj9ZsEpaUvIPua+5ex IMXAhR0dMKFXxdTUtY1vpXt21s3P2OFSoHjo7o2gHjOrCoXrO24fU/ZSDdemMLPr0GnP OvVBu5W4vSmbhxj4+/36OUihUcEj0hBl/cviWOE7W2kJzatCo5dKsvWfz10mp9HqKz3q MPmCF7rnPdSpwMNzp6zmFJzQyWa0RjLqDADAX47tVgJl28VAWHxfoTAw4+uR0x1i5Oy/ jrkA== 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 q14-20020aa7cc0e000000b005184a8f7212si12630118edt.493.2023.07.04.15.23.22; Tue, 04 Jul 2023 15:23:24 -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 913F168C64E; Wed, 5 Jul 2023 01:23:12 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 91CBD68C21C for ; Wed, 5 Jul 2023 01:23:05 +0300 (EEST) X-GND-Sasl: michael@niedermayer.cc Received: by mail.gandi.net (Postfix) with ESMTPSA id CC66440005 for ; Tue, 4 Jul 2023 22:23:04 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 5 Jul 2023 00:22:58 +0200 Message-Id: <20230704222302.1129450-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230704222302.1129450-1-michael@niedermayer.cc> References: <20230704222302.1129450-1-michael@niedermayer.cc> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/6] avradio: Fill in missing bandwidth values at 80% of frequency 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: Cvtp6mF1XaiG The previous of 100% was a unrealistic default Signed-off-by: Michael Niedermayer --- libavradio/sdrdemux.c | 2 ++ libavradio/sdrinradio.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libavradio/sdrdemux.c b/libavradio/sdrdemux.c index cb5e7afb2f..39e2e54ee7 100644 --- a/libavradio/sdrdemux.c +++ b/libavradio/sdrdemux.c @@ -1401,6 +1401,8 @@ static int sdrfile_initial_setup(AVFormatContext *s) sdr->bandwidth = sdr->sdr_sample_rate; sdr->fileheader_size = 40; } + if (sdr->bandwidth >= sdr->sdr_sample_rate) + sdr->bandwidth = sdr->sdr_sample_rate * 4 / 5; //After reading the first packet header we return to the begin so the packet can be read whole avio_seek(s->pb, 0, SEEK_SET); diff --git a/libavradio/sdrinradio.c b/libavradio/sdrinradio.c index 3a0b7f8ab4..c6f5742436 100644 --- a/libavradio/sdrinradio.c +++ b/libavradio/sdrinradio.c @@ -320,7 +320,7 @@ static int sdrindev_initial_hw_setup(AVFormatContext *s) // rtlsdr doesnt return a valid value if (!sdr->bandwidth) - sdr->bandwidth = sdr->sdr_sample_rate; + sdr->bandwidth = sdr->sdr_sample_rate * 4 / 5; av_log(s, AV_LOG_INFO, "bandwidth %"PRId64"\n", sdr->bandwidth); SoapySDRDevice_activateStream(soapy, soapyRxStream, 0, 0, 0);