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 2A5CC40CA6 for ; Fri, 8 Jul 2022 22:55:35 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6FAAF68B9B5; Sat, 9 Jul 2022 01:54:36 +0300 (EEST) Received: from btbn.de (btbn.de [136.243.74.85]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ED03A68B90D for ; Sat, 9 Jul 2022 01:54:27 +0300 (EEST) Received: from [authenticated] by btbn.de (Postfix) with ESMTPSA id D8EF9316FBA; Sat, 9 Jul 2022 00:54:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothenpieler.org; s=mail; t=1657320861; bh=1nQPcAKKAqvzv0Vuf5xUolsyvwAiPr6eeSf6BqUx7aQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=U51Z0+AvL7XQsOvBfmjdFxyEk7tZwC2g1WYhfm8LPNUwY9GPOpev+b22BOL7RZDVQ sD+iSmGOdMpy7Roi6FJAQEozPvRzzcUV+NFZbDrlHTgKeZzGXkVnJMKZu66rBwupvI yahJmQEwPjvxNri6CKytLNMwHhVe2zlGK+3OJ2Zj3NvRyI5ftddXepJLZSpgntdvtK AT1AXGNMB+n5OwZgpe+NWQLLlTx9JboKlebTOjG8NtoCGtHp2P6MckzsEIgvGVpS14 ETxylU402GnV9TB066JR90akIdO6lzeObHpHdNq7an30fu/3Hm7Vl/6RFdU7uLsuAN wBBFNVXnl4GKw== From: Timo Rothenpieler To: ffmpeg-devel@ffmpeg.org Date: Sat, 9 Jul 2022 00:54:03 +0200 Message-Id: <20220708225404.23748-8-timo@rothenpieler.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220708225404.23748-1-timo@rothenpieler.org> References: <20220708225404.23748-1-timo@rothenpieler.org> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 7/8] 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".