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 1939847329 for ; Mon, 4 Dec 2023 23:27:35 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 88CA868CBFF; Tue, 5 Dec 2023 01:27:32 +0200 (EET) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4932868C7A2 for ; Tue, 5 Dec 2023 01:27:26 +0200 (EET) Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-40b5155e154so53265245e9.3 for ; Mon, 04 Dec 2023 15:27:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701732444; x=1702337244; darn=ffmpeg.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=+T9OufaKAp97LodnQYDXdSGNmrOfedw0u83Ck+nkESU=; b=HreFZs80y9mwbpX6zd8lFhZGUEPJFaEBeoFJ2vfkrVJyfxJOY4evcUZoXA+vyXCFRZ LHnYlhMw7kg6tPG5PSKdaei59Inmcd83iW8cWrpGf5tDv9+zOPbH3Gq7/E5rGaY7O1qx FrRoUbenaGVPthRYwaUyr09T9Lgdgiwm8w65svBWDxM/joD9PZk9S4/BKpaTYVimRmOP F1qadisH58i+cA6dPc1zsGioCuk+5TeL23hkEs89WkIFR3HJCiQOmcJ/7ovIZ4FKccAy Xqec1kPB7dWCjyQPB1BkQlQJaGQ1DUrbxopowu0sBSMBKPWn19ruHYWaw4OWf1SxElM4 mXWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701732444; x=1702337244; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=+T9OufaKAp97LodnQYDXdSGNmrOfedw0u83Ck+nkESU=; b=QYxPWo3aeXz+mNV0cEi5qH6nQQNFw+IDreJoywn0PASE5NKGST6/8sYhdCsjChQx2r xyGL8evHHdBGhuqgauJjGCfPktsonLBswy/D0gseAzu/7lbpN1jl1YubXtC6hJv/qr3E Y8c7IC9IQgJKRQmAD1geJEm28g9qc06W7a8fJCFHw1Lo+itwPHFsMDarxreEHMQqH/rn lpMaNniDMw3jvdiSfEpwCzi5gg2ve1iYUi746DBm3/PR2n53ek6O7SjWbJGh7LJA2304 YYNVpdHZhz3sxbCBRDYMpCHh5Zx+CJrkp0HDz49mHEmp/pj57Ze+SbR/UHXS7dx6IdGc Tuyg== X-Gm-Message-State: AOJu0Yz1DBDZtE1zk/7iI5Sg/GxKzsuQlUefOcUefFBo2UKqSajje9XJ ikBpjpybAcxh5sd9zjgUKRcfw+sD0pM= X-Google-Smtp-Source: AGHT+IG1fqXkGlb2RlKOO/KNlQnfEt0jEoRIgPx8kqCkTVj5HgWk54uk8rWhVZ5fuUm/+RDMTNEmnQ== X-Received: by 2002:a05:600c:4707:b0:40b:36e9:bf4b with SMTP id v7-20020a05600c470700b0040b36e9bf4bmr2682931wmo.41.1701732444321; Mon, 04 Dec 2023 15:27:24 -0800 (PST) Received: from mariano (dynamic-adsl-84-220-189-10.clienti.tiscali.it. [84.220.189.10]) by smtp.gmail.com with ESMTPSA id q19-20020a1709060e5300b009a19701e7b5sm5816743eji.96.2023.12.04.15.27.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 15:27:23 -0800 (PST) Received: by mariano (Postfix, from userid 1000) id 8F766BFCDA; Tue, 5 Dec 2023 00:27:22 +0100 (CET) Date: Tue, 5 Dec 2023 00:27:22 +0100 From: Stefano Sabatini To: FFmpeg development discussions and patches Message-ID: Mail-Followup-To: FFmpeg development discussions and patches References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.1.4 (2021-12-11) Subject: Re: [FFmpeg-devel] [PATCH] libavfilter/asrc_flite: fixes and improvements 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 date Sunday 2023-12-03 23:23:48 +0100, Paul B Mahol wrote: > Attached. > From fe1ece70c0ecbe6fb24e0823fe46db57242396e4 Mon Sep 17 00:00:00 2001 > From: Paul B Mahol > Date: Sun, 3 Dec 2023 21:38:08 +0100 > Subject: [PATCH 1/2] avfilter/asrc_flite: switch to activate > > Allows to set EOF timestamp. > > Signed-off-by: Paul B Mahol > --- > libavfilter/asrc_flite.c | 24 +++++++++++++----------- > 1 file changed, 13 insertions(+), 11 deletions(-) Cannot really comment, but should be good if tested. > From e8aad4411ee0f8bc4bd50d5e3a10b7f712687f60 Mon Sep 17 00:00:00 2001 > From: Paul B Mahol > Date: Sun, 3 Dec 2023 22:50:11 +0100 > Subject: [PATCH 2/2] avfilter/asrc_flite: use streaming function > > Fix continuous accumulation of audio samples for big txt inputs. > > Signed-off-by: Paul B Mahol > --- > libavfilter/asrc_flite.c | 84 ++++++++++++++++++++++++++++++---------- > 1 file changed, 64 insertions(+), 20 deletions(-) > > diff --git a/libavfilter/asrc_flite.c b/libavfilter/asrc_flite.c > index 74c8414b5c..70a2fd3e40 100644 > --- a/libavfilter/asrc_flite.c > +++ b/libavfilter/asrc_flite.c > @@ -24,6 +24,8 @@ > */ > > #include > +#include "libavutil/audio_fifo.h" > +#include "libavutil/avstring.h" > #include "libavutil/channel_layout.h" > #include "libavutil/file.h" > #include "libavutil/opt.h" > @@ -39,11 +41,14 @@ typedef struct FliteContext { > char *voice_str; > char *textfile; > char *text; > - cst_wave *wave; > - int16_t *wave_samples; > - int wave_nb_samples; > + char *text_p; > + char *text_saveptr; > + int nb_channels; > + int sample_rate; > + AVAudioFifo *fifo; > int list_voices; > cst_voice *voice; > + cst_audio_streaming_info *asi; > struct voice_entry *voice_entry; > int64_t pts; > int frame_nb_samples; ///< number of samples per frame > @@ -140,10 +145,30 @@ static int select_voice(struct voice_entry **entry_ret, const char *voice_name, > return AVERROR(EINVAL); > } > > +static int audio_stream_chunk_by_word(const cst_wave *w, int start, int size, nit+: w -> wave to simplify reading > + int last, cst_audio_streaming_info *asi) > +{ > + FliteContext *flite = asi->userdata; > + void *const ptr[8] = { &w->samples[start] }; > + > + flite->nb_channels = w->num_channels; > + flite->sample_rate = w->sample_rate; > + if (!flite->fifo) { > + flite->fifo = av_audio_fifo_alloc(AV_SAMPLE_FMT_S16, flite->nb_channels, size); any reason to initialize it here rather than in init? > + if (!flite->fifo) > + return CST_AUDIO_STREAM_STOP; [...] LGTM otherwise, thanks. _______________________________________________ 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".