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 6DA0A40BD9 for ; Thu, 7 Jul 2022 16:13:38 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B7D3968B8CF; Thu, 7 Jul 2022 19:13:24 +0300 (EEST) Received: from btbn.de (btbn.de [136.243.74.85]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7D7C168B88B for ; Thu, 7 Jul 2022 19:13:17 +0300 (EEST) Received: from [authenticated] by btbn.de (Postfix) with ESMTPSA id 1B49A39E27C; Thu, 7 Jul 2022 18:13:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothenpieler.org; s=mail; t=1657210397; bh=1nQPcAKKAqvzv0Vuf5xUolsyvwAiPr6eeSf6BqUx7aQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=NjX8Pk4nlOXllOWqlgqtAUGm0weojVe4OZgbStpwx9AyFKKKt6i4BsI3zBSpYM47w GIUSaPBHW6vrAucu6gksRV8IRyfqq2H1vfOQQUWxwWiKbO/55MsHR8m/WrRhuf+fGn GnLgrUbVUkNwUYzivDhlh3x3Cb3eNfEggG0B2UzbusLM7TS98DYS17/Lq9DdTosSDg WdszqAXyNmdQVEvV2Y980GJ+TCafPq1vQZDcQXE3Qa2XpWhbVfcnRD5dAHFXanSNPe wDxBOkmH2iAhBwJyFGdv0MoEGqFHbxOJ11qOyX85yNO6wRdihn9nJGg49WZQNulOUA KdjYup8VxDsmg== From: Timo Rothenpieler To: ffmpeg-devel@ffmpeg.org Date: Thu, 7 Jul 2022 18:13:07 +0200 Message-Id: <20220707161307.1136-2-timo@rothenpieler.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220707161307.1136-1-timo@rothenpieler.org> References: <20220707161307.1136-1-timo@rothenpieler.org> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] avdevice/lavfi: pass forward video framerate 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 Cc: Timo Rothenpieler 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: --- libavdevice/lavfi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c index 1b282a70cb..246f7dff3b 100644 --- a/libavdevice/lavfi.c +++ b/libavdevice/lavfi.c @@ -287,6 +287,7 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx) for (i = 0; i < lavfi->nb_sinks; i++) { AVFilterContext *sink = lavfi->sinks[lavfi->stream_sink_map[i]]; AVRational time_base = av_buffersink_get_time_base(sink); + AVRational frame_rate = av_buffersink_get_frame_rate(sink); AVStream *st = avctx->streams[i]; AVCodecParameters *const par = st->codecpar; avpriv_set_pts_info(st, 64, time_base.num, time_base.den); @@ -299,6 +300,10 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx) avctx->probesize = FFMAX(avctx->probesize, sizeof(AVFrame) * 30); st ->sample_aspect_ratio = par->sample_aspect_ratio = av_buffersink_get_sample_aspect_ratio(sink); + if (frame_rate.num > 0 && frame_rate.den > 0) { + st->avg_frame_rate = frame_rate; + st->r_frame_rate = frame_rate; + } } else if (par->codec_type == AVMEDIA_TYPE_AUDIO) { par->sample_rate = av_buffersink_get_sample_rate(sink); ret = av_buffersink_get_ch_layout(sink, &par->ch_layout); -- 2.34.1 _______________________________________________ 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".