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 1F57B48CA1 for ; Wed, 24 Jan 2024 08:18:56 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0BB0E68D17B; Wed, 24 Jan 2024 10:17:37 +0200 (EET) Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 29EA868D0EE 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=f9dgkDBO; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 664821A3D 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 tlqBNZmzdraC 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=5VOWEXc2H+avHJWbhggZQspaNgZMrtr0eprIruBXxtk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=f9dgkDBO9zsfm1yqN27Gv7ISTYI39sjDK/ylIh82hzwJ942NLvsryyKx25+Sco7Cg XsvJ6HMed9xESroonCZOJzKK9Z+qj650AR6ey3SQnlQQyEqFKBmQE1eSVYXi97X2G2 LrmeWK38xijxcymR08zdv645Kf9ZC22C7EB9Dc3ClWsDR5GnOou5Q7lU7KQdJYjzhJ NVPzgUbfT5wcD/NhDF42hiSV59by4+UKXlyd4IQO264PpP3hDjVqkqv/fR2b3kfOfj hGZSo47136ywOyVf2I7FxNu5UeN38hu7p+KZp5fpBazrMlJnHIKPkFKgE+XZzrAwt0 5XROz2IN70YrQ== 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 EB5D11A44 for ; Wed, 24 Jan 2024 09:17:19 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id DD2433A07AE for ; Wed, 24 Jan 2024 09:17:19 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 24 Jan 2024 09:16:47 +0100 Message-ID: <20240124081702.4759-17-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 17/31] fftools/ffmpeg_dec: move flags to 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: Will be useful in the following commit. --- fftools/ffmpeg.h | 4 +++- fftools/ffmpeg_dec.c | 4 ++-- fftools/ffmpeg_demux.c | 7 ++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index abf95f106b..b4288e7352 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -287,6 +287,8 @@ enum DecoderFlags { }; typedef struct DecoderOpts { + int flags; + /* hwaccel options */ enum HWAccelID hwaccel_id; enum AVHWDeviceType hwaccel_device_type; @@ -738,7 +740,7 @@ AVBufferRef *hw_device_for_filter(void); * is transferred to the decoder. */ int dec_open(InputStream *ist, Scheduler *sch, unsigned sch_idx, - AVDictionary **dec_opts, int flags, const DecoderOpts *o); + AVDictionary **dec_opts, const DecoderOpts *o); void dec_free(Decoder **pdec); int dec_add_filter(Decoder *dec, InputFilter *ifilter); diff --git a/fftools/ffmpeg_dec.c b/fftools/ffmpeg_dec.c index 0cbe16ea5f..babfeb1b96 100644 --- a/fftools/ffmpeg_dec.c +++ b/fftools/ffmpeg_dec.c @@ -943,7 +943,7 @@ static const AVClass dec_class = { }; int dec_open(InputStream *ist, Scheduler *sch, unsigned sch_idx, - AVDictionary **dec_opts, int flags, const DecoderOpts *o) + AVDictionary **dec_opts, const DecoderOpts *o) { DecoderPriv *dp; const AVCodec *codec = ist->dec; @@ -957,7 +957,7 @@ int dec_open(InputStream *ist, Scheduler *sch, unsigned sch_idx, dp->sch = sch; dp->sch_idx = sch_idx; - dp->flags = flags; + dp->flags = o->flags; dp->dec.class = &dec_class; dp->log_parent = ist; diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c index 0f426e3c2e..5ee07f706b 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -893,8 +893,6 @@ static int ist_use(InputStream *ist, int decoding_needed) if (decoding_needed && ds->sch_idx_dec < 0) { int is_audio = ist->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO; - int dec_flags = (!!ist->fix_sub_duration * DECODER_FLAG_FIX_SUB_DURATION) | - (!!(d->f.ctx->iformat->flags & AVFMT_NOTIMESTAMPS) * DECODER_FLAG_TS_UNRELIABLE); ret = sch_add_dec(d->sch, decoder_thread, ist, d->loop && is_audio); if (ret < 0) @@ -906,8 +904,11 @@ static int ist_use(InputStream *ist, int decoding_needed) if (ret < 0) return ret; + ds->dec_opts.flags = (!!ist->fix_sub_duration * DECODER_FLAG_FIX_SUB_DURATION) | + (!!(d->f.ctx->iformat->flags & AVFMT_NOTIMESTAMPS) * DECODER_FLAG_TS_UNRELIABLE); + ret = dec_open(ist, d->sch, ds->sch_idx_dec, - &ist->decoder_opts, dec_flags, &ds->dec_opts); + &ist->decoder_opts, &ds->dec_opts); if (ret < 0) return ret; -- 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".