From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 99FDA449C7 for ; Wed, 4 Jan 2023 17:21:09 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9E8DB68BCE7; Wed, 4 Jan 2023 19:21:07 +0200 (EET) Received: from mail-vs1-f48.google.com (mail-vs1-f48.google.com [209.85.217.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6D95D68B103 for ; Wed, 4 Jan 2023 19:21:01 +0200 (EET) Received: by mail-vs1-f48.google.com with SMTP id o63so30733876vsc.10 for ; Wed, 04 Jan 2023 09:21:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=yMFqDsxi8hwE+9BBi7rw4Ew64uL5Q9aL9+Qt97nQknM=; b=GYihrSVAUYu5wx7GYUhF4n8geUQhNnlZVsu0WfMokLW4yCHE5K5GM7IiCkcpSezNiQ s8NfrXBkoT5GR1XYFhZOtRZ9E4/sdmeffaqhxHEuVhNA0WXnhuEcqvBAJlOTmNWlH/eW Yhjjja4awJWAx8yqGG5v03fKnPXn68hg/dmCTikkdxpPq7Ge4Xh36U1az1hN1pcv+VQb IOUicbKBiuRRxN+QU8LLFz/UBWJEolTP3kTyoBZb+Abd988XrkoalDQhukRs3v/b+Jkx Gyk+CX7J7SJYHONKkNLEppf5Qnl9yQKwtCunDUbkaEMbEwZVTYoETWlNnOMh2kz0+65k EUhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yMFqDsxi8hwE+9BBi7rw4Ew64uL5Q9aL9+Qt97nQknM=; b=mIKParlTlfpJJWKBmPa/NFN9EKnZK10TplQ9i1CNdEC1d2eklQtixpuxMzy+3JQDBY YNdXrP9/lf6VmMAT0Lp0Qrdx3TpP0l4DhAhKbXJ9yllzNM7O6tvTHRwS+kkrypAEHKS9 FovCIvZZ78XN2Q1ZLIZ95WEWtzcdQLOOwLX0OInSXPKN9vA/9l3EpgdT5YFFrqi9FYWC DN4MOr9nnV59/UAPHBwD8BGOQzWCBp2LWLd5Te9Ic9InLoqvIa9S48zN0CRJLM9hg05Q 9a6u1wq/LcY/4/Np8DlngJgUipyrn5Q20wvrjvLdSqol5dlK9iNv3qpyvfUHNTmzsRma /OXw== X-Gm-Message-State: AFqh2krxStQdcgSsHTZtdnmmP/8YIu/0CRu/ux+sagKyqaa0TuzoN1oq mSKCXeMm1ypvRkT7rVUxlqDKe7i3Su3+UEordsGeXKyj X-Google-Smtp-Source: AMrXdXuS8WekEqu+p9KiR/8XQXCRJBBhr1p+DW6/3zMtKIuA0Ye15nzywc4aJ1nAx9uauQISMw1D/etVTdJMUZcNSWA= X-Received: by 2002:a67:ec94:0:b0:3b5:32d0:edcc with SMTP id h20-20020a67ec94000000b003b532d0edccmr5417318vsp.24.1672852859212; Wed, 04 Jan 2023 09:20:59 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Paul B Mahol Date: Wed, 4 Jan 2023 18:25:58 +0100 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH] swresample fixes 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Wed, Jan 4, 2023 at 6:18 PM Andreas Rheinhardt < andreas.rheinhardt@outlook.com> wrote: > Paul B Mahol: > > diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c > > index 971c861d0e..7923377c8c 100644 > > --- a/libavfilter/af_aresample.c > > +++ b/libavfilter/af_aresample.c > > @@ -209,18 +209,16 @@ FF_ENABLE_DEPRECATION_WARNINGS > > } else { > > outsamplesref->pts = AV_NOPTS_VALUE; > > } > > - n_out = swr_convert(aresample->swr, outsamplesref->extended_data, > n_out, > > - (void *)insamplesref->extended_data, > n_in); > > - if (n_out <= 0) { > > + ret = swr_convert_frame(aresample->swr, outsamplesref, > > + (void *)insamplesref); > > Don't know whether the actual change has advantages, but you should not > It adds better support for runtime change of input/output sample rates. Instead of re-initializing whole filter graph. > cast here. The cast above exists because there is no automatic cast > T**->const T** (it is actually unsafe; we should change swr_convert() to > accept const uint8_t *const * for in and uint8_t *const * for out at the > next major version bump, but even then C requires the cast). There is no > reason for a cast with the new code. > > > + if (ret < 0) { > > av_frame_free(&outsamplesref); > > av_frame_free(&insamplesref); > > - return 0; > > + return ret; > > } > > > > aresample->more_data = outsamplesref->nb_samples == n_out; // > Indicate that there is probably more data in our buffers > > > > - outsamplesref->nb_samples = n_out; > > - > > ret = ff_filter_frame(outlink, outsamplesref); > > av_frame_free(&insamplesref); > > return ret; > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".