From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTPS id D798A4DB9A
	for <ffmpegdev@gitmailbox.com>; Wed, 23 Apr 2025 04:17:10 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DBFEF687DD0;
	Wed, 23 Apr 2025 07:17:05 +0300 (EEST)
Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4132E687D46
 for <ffmpeg-devel@ffmpeg.org>; Wed, 23 Apr 2025 07:16:59 +0300 (EEST)
Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4Zj5Qx17MXz9tTZ
 for <ffmpeg-devel@ffmpeg.org>; Wed, 23 Apr 2025 06:16:57 +0200 (CEST)
Message-ID: <efcd69f9-b938-4ba5-93a2-9656c65d84fb@gyani.pro>
Date: Wed, 23 Apr 2025 09:46:54 +0530
MIME-Version: 1.0
To: ffmpeg-devel@ffmpeg.org
References: <20250422205640.35763-1-epirat07@gmail.com>
 <20250422205640.35763-2-epirat07@gmail.com>
Content-Language: en-US
From: Gyan Doshi <ffmpeg@gyani.pro>
In-Reply-To: <20250422205640.35763-2-epirat07@gmail.com>
Subject: Re: [FFmpeg-devel] [RFC PATCH 2/2] ffmpeg_demux: make readrate
 stall warning input-specific
X-BeenThere: ffmpeg-devel@ffmpeg.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/efcd69f9-b938-4ba5-93a2-9656c65d84fb@gyani.pro/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>



On 2025-04-23 02:26 am, Marvin Scholz wrote:
> Given the readrate catchup is input-specific, it seems to make sense to
> also warn on a per-input demux basis.

We want to warn once each time reading is resumed but only for the first 
stream resumption. That's the case right now.
With this change, if an input stalls thrice, only the resumption after 
the first stall will get reported.

Regards,
Gyan


> ---
>   fftools/ffmpeg_demux.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
> index 6e01efc420..1f7ec20a43 100644
> --- a/fftools/ffmpeg_demux.c
> +++ b/fftools/ffmpeg_demux.c
> @@ -101,6 +101,8 @@ typedef struct DemuxStream {
>       int64_t                  resume_pts;
>       // measure of how far behind packet reading is against spceified readrate
>       int64_t                  lag;
> +    // state for resume after stall warning
> +    int                      resume_warned;
>   } DemuxStream;
>   
>   typedef struct Demuxer {
> @@ -504,7 +506,6 @@ static void readrate_sleep(Demuxer *d)
>                             (f->start_time != AV_NOPTS_VALUE ? f->start_time : 0)
>                            );
>       int64_t initial_burst = AV_TIME_BASE * d->readrate_initial_burst;
> -    int resume_warn = 0;
>   
>       for (int i = 0; i < f->nb_streams; i++) {
>           InputStream *ist = f->streams[i];
> @@ -523,12 +524,12 @@ static void readrate_sleep(Demuxer *d)
>               ds->lag = lag;
>               ds->resume_wc = now;
>               ds->resume_pts = pts;
> -            av_log_once(ds, AV_LOG_WARNING, AV_LOG_DEBUG, &resume_warn,
> +            av_log_once(ds, AV_LOG_WARNING, AV_LOG_DEBUG, &ds->resume_warned,
>                           "Resumed reading at pts %0.3f with rate %0.3f after a lag of %0.3fs\n",
>                           (float)pts/AV_TIME_BASE, d->readrate_catchup, (float)lag/AV_TIME_BASE);
>           }
>           if (ds->lag && !lag)
> -            ds->lag = ds->resume_wc = ds->resume_pts = 0;
> +            ds->lag = ds->resume_wc = ds->resume_pts = ds->resume_warned = 0;
>           if (ds->resume_wc) {
>               elapsed = now - ds->resume_wc;
>               limit_pts = ds->resume_pts + elapsed * d->readrate_catchup;

_______________________________________________
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".