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 5D60248CAE for ; Wed, 24 Jan 2024 08:20:46 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 92DC268D1B4; Wed, 24 Jan 2024 10:17:51 +0200 (EET) Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5496368D105 for ; Wed, 24 Jan 2024 10:17:27 +0200 (EET) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=AgV3lW1E; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id CDE141A3B for ; Wed, 24 Jan 2024 09:17:23 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id 415oBWpdMgUx for ; Wed, 24 Jan 2024 09:17:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1706084240; bh=wZf4m10HqQj1hTyMSRd7TkCywEXVmCoPOw7jIYh5veQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=AgV3lW1EvkV6nlXPezui0rnuLzxkVomWiolSsrzBYv31IdnZ+2zCnTKCBy491Pz9O TFecFkVLfTAmlRAgd51hO50JuS20W6MRhrhuMPme9E5sBgwYfUrHHki6L5fWihgNs9 r+zr7d1lvRhDZLE780jWQkDnNaR75K9K6ENQKdHBF61UiWiKhe4OXmbHP1JuNAJAia h8oxXcruQ7J+7Y5jrqP9PoWN0+AM72neGbDMsMs8k7US5jKhbU8ww6Z0vadAOq6xVt KkjlGoUkClWoZq/4FPzjymv9W72gLzaFTIG1vX0Ys3eQJC0bRxwZc/djIi/1Kjmjv1 K3tItTx5lOpuQ== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id 178D51BAF for ; Wed, 24 Jan 2024 09:17:20 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 0B1E43A054A for ; Wed, 24 Jan 2024 09:17:20 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 24 Jan 2024 09:16:50 +0100 Message-ID: <20240124081702.4759-20-anton@khirnov.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240124081702.4759-1-anton@khirnov.net> References: <20240124081702.4759-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 20/31] fftools/ffmpeg_dec: pass input timebase through DecoderOpts 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: Do not read it from AVStream directly. This is a step towards decoupling Decoder and InputStream. --- fftools/ffmpeg.h | 2 ++ fftools/ffmpeg_dec.c | 5 +---- fftools/ffmpeg_demux.c | 2 ++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index 106f943a2b..5d6a538aa0 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -298,6 +298,8 @@ typedef struct DecoderOpts { char *hwaccel_device; enum AVPixelFormat hwaccel_output_format; + AVRational time_base; + // Either forced (when DECODER_FLAG_FRAMERATE_FORCED is set) or // estimated (otherwise) video framerate. AVRational framerate; diff --git a/fftools/ffmpeg_dec.c b/fftools/ffmpeg_dec.c index 46eac025a3..4a2ea83f97 100644 --- a/fftools/ffmpeg_dec.c +++ b/fftools/ffmpeg_dec.c @@ -998,10 +998,7 @@ int dec_open(InputStream *ist, Scheduler *sch, unsigned sch_idx, dp->dec_ctx->opaque = dp; dp->dec_ctx->get_format = get_format; - - /* Useful for subtitles retiming by lavf (FIXME), skipping samples in - * audio, and video decoders such as cuvid or mediacodec */ - dp->dec_ctx->pkt_timebase = ist->st->time_base; + dp->dec_ctx->pkt_timebase = o->time_base; if (!av_dict_get(*dec_opts, "threads", NULL, 0)) av_dict_set(dec_opts, "threads", "auto", 0); diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c index 7cb85c127a..4cced4a7f8 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -1152,6 +1152,8 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st) ds->first_dts = AV_NOPTS_VALUE; ds->next_dts = AV_NOPTS_VALUE; + ds->dec_opts.time_base = st->time_base; + ds->ts_scale = 1.0; MATCH_PER_STREAM_OPT(ts_scale, dbl, ds->ts_scale, ic, st); -- 2.42.0 _______________________________________________ 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".