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 06E1C48C9F for ; Wed, 24 Jan 2024 08:18:47 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 12C2768D177; Wed, 24 Jan 2024 10:17:36 +0200 (EET) Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2466D68D0EC 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=Ja/168jS; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id B1FE81A3F 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 bFHIYE9b9DrW 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=zF6nWp1lXQ4vOzFnvtpHgDrVcfJJy+4x1JXa1sVPA7k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Ja/168jSVQPhG5v55dKZlGYtSHnKXdrGD0//0Siz5+VhbavgegCQYfuxBSjIeuheQ xr6noMWy72PFZtLj8h81yfBfsTvFbOKuPmwxhMNz+B/4dWINcz1Z6waMjFKUhKPbYT J+lCAxuJrnlRE249Y45UkQEyu2hRqHq+tuMWAGGyEzWqIBODy3EMDdMQfMkd6perI7 iB0AMCIXv/NpfUHg5IWgRCeQN7kh/m//BhSm4DvXC+cq6Yq5TVUDVoflwFLJ8Dt29a H3abnsbyPWP8tnUTw+aQkdZpekox7Id7u7iJR+KKzIOoCheBsPcTNIi2ZdP5bOCD/w oPPSYP3v5mjmA== 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 0BBB21BAE 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 0033A3A0582 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:49 +0100 Message-ID: <20240124081702.4759-19-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 19/31] fftools/ffmpeg_dec: move setting compute_edt to demuxer 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: It is done based on demuxer information, so that is the more appropriate place for this code. This is a step towards decoupling Decoder and InputStream. --- fftools/ffmpeg_dec.c | 9 --------- fftools/ffmpeg_demux.c | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fftools/ffmpeg_dec.c b/fftools/ffmpeg_dec.c index 937e969988..46eac025a3 100644 --- a/fftools/ffmpeg_dec.c +++ b/fftools/ffmpeg_dec.c @@ -999,15 +999,6 @@ int dec_open(InputStream *ist, Scheduler *sch, unsigned sch_idx, dp->dec_ctx->opaque = dp; dp->dec_ctx->get_format = get_format; - if (dp->dec_ctx->codec_id == AV_CODEC_ID_DVB_SUBTITLE && - (ist->decoding_needed & DECODING_FOR_OST)) { - av_dict_set(dec_opts, "compute_edt", "1", AV_DICT_DONT_OVERWRITE); - if (ist->decoding_needed & DECODING_FOR_FILTER) - av_log(dp, AV_LOG_WARNING, - "Warning using DVB subtitles for filtering and output at the " - "same time is not fully supported, also see -compute_edt [0|1]\n"); - } - /* 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; diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c index 2a34f97545..7cb85c127a 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -913,6 +913,15 @@ static int ist_use(InputStream *ist, int decoding_needed) } else ds->dec_opts.framerate = ist->st->avg_frame_rate; + if (ist->dec->id == AV_CODEC_ID_DVB_SUBTITLE && + (ist->decoding_needed & DECODING_FOR_OST)) { + av_dict_set(&ist->decoder_opts, "compute_edt", "1", AV_DICT_DONT_OVERWRITE); + if (ist->decoding_needed & DECODING_FOR_FILTER) + av_log(ist, AV_LOG_WARNING, + "Warning using DVB subtitles for filtering and output at the " + "same time is not fully supported, also see -compute_edt [0|1]\n"); + } + ret = dec_open(ist, d->sch, ds->sch_idx_dec, &ist->decoder_opts, &ds->dec_opts); if (ret < 0) -- 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".