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 A910F47355 for ; Tue, 5 Sep 2023 17:44:44 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5347D68C808; Tue, 5 Sep 2023 20:44:30 +0300 (EEST) Received: from mail-oa1-f43.google.com (mail-oa1-f43.google.com [209.85.160.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2C2BB68C7FD for ; Tue, 5 Sep 2023 20:44:22 +0300 (EEST) Received: by mail-oa1-f43.google.com with SMTP id 586e51a60fabf-1c50438636fso2162806fac.1 for ; Tue, 05 Sep 2023 10:44:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693935859; x=1694540659; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=K8puxiGfqXYslvzpdy+Iv3JpC7MCOEk8m2m0umVYJRs=; b=TEqts0c4Ho2rgh9SNFSVr42xWhclwGbP3vPDhgMpeykzatMES6svRtHbrZPGljPu/0 UaULYxistqYSg5WKFBOhUojfhwkMbmyAxm3UTp6w0wFN4XBeuX1R7oThxw4P+fqdxV6C dO5JYBKQojAEnNVjLsnRMPnLIa0Izj2k6UY3ZKkgy1rozvcp7lWlIiSf7XF2rtwoT0Dd hhbB834bwdfuXfcVONTMi0LnVqj8bqyYCMeS2IkG/idh04D9vazLISL0DDFCCdihifA8 LznS9b4eZqje/owz1tmpVWLbVmMJ9wBwrKbNbXAJLzFJ1dfjxY3gCAXf23bMfWSdZYtg COQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693935859; x=1694540659; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K8puxiGfqXYslvzpdy+Iv3JpC7MCOEk8m2m0umVYJRs=; b=L63LTWrQA/eMviRL0U8qsr7Qkc8D/M3Su83ShVBPPhViODjXaZrDa/YLGadBL9+bXM p0e5NTJtwWCmsmdNYlSuCgs78rrJaPmV/xq8/lBFb5Gs7qeDeT0KR5EvwLiVL8dTmm8X yLA56T/Eng0WB7oXRvnmYufxVLFmzmpVrKgLGVVb6A5yp7M3F2/b1h2fqs91OxL3afBy 2rkD3VRNM2Ea5H/vG6/NjARjSDphcDNfAS/S17cs+z2iJ1lu6QeMaQzItTCmaJfD4WEc VDWQjHbid3GbktTLKOVg5EV9eofpiXg9Ebr50Huv6gTnK8/DMDzAeSXuLMPJPCS6zITU QyrQ== X-Gm-Message-State: AOJu0Yw6IA99h+1gIkXljC9kp3h8j0UpXG3L5WWe+JJiv/PSSoe4juAX +gfWYRMNLcnqktBNCjMRm4ClG/jvAM4= X-Google-Smtp-Source: AGHT+IFJPX1NIDSxa4hDZM05heckqt4VyIBt4c7P6rq9aj5/Lzxw9oohSeNPq0tF+42aa1LOUfOEfw== X-Received: by 2002:a05:6870:f60e:b0:1be:f8d9:7bdd with SMTP id ek14-20020a056870f60e00b001bef8d97bddmr16927718oab.6.1693935859153; Tue, 05 Sep 2023 10:44:19 -0700 (PDT) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id y9-20020a9d6349000000b006bee51de9f6sm5673148otk.18.2023.09.05.10.44.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Sep 2023 10:44:18 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Tue, 5 Sep 2023 14:43:35 -0300 Message-ID: <20230905174336.3585-3-jamrial@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230905174336.3585-1-jamrial@gmail.com> References: <20230905174336.3585-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/4] avcodec/mpeg12dec: stop propagating AVCPBProperties side data 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's already exported using the relevant AVCodecContext fields. Signed-off-by: James Almer --- libavcodec/mpeg12dec.c | 10 ++-------- libavcodec/mpegvideo_parser.c | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index 2290a90778..1accd07e9e 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -1248,7 +1248,8 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) if (ret < 0) return ret; - if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && s->bit_rate) { + if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && s->bit_rate && + (s->bit_rate != 0x3FFFF*400)) { avctx->rc_max_rate = s->bit_rate; } else if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO && s->bit_rate && (s->bit_rate != 0x3FFFF*400 || s->vbv_delay != 0xFFFF)) { @@ -1371,7 +1372,6 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1) MpegEncContext *s = &s1->mpeg_enc_ctx; int horiz_size_ext, vert_size_ext; int bit_rate_ext; - AVCPBProperties *cpb_props; skip_bits(&s->gb, 1); /* profile and level esc*/ s->avctx->profile = get_bits(&s->gb, 3); @@ -1403,12 +1403,6 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1) ff_dlog(s->avctx, "sequence extension\n"); s->codec_id = s->avctx->codec_id = AV_CODEC_ID_MPEG2VIDEO; - if (cpb_props = ff_add_cpb_side_data(s->avctx)) { - cpb_props->buffer_size = s->avctx->rc_buffer_size; - if (s->bit_rate != 0x3FFFF*400) - cpb_props->max_bitrate = s->bit_rate; - } - if (s->avctx->debug & FF_DEBUG_PICT_INFO) av_log(s->avctx, AV_LOG_DEBUG, "profile: %d, level: %d ps: %d cf:%d vbv buffer: %d, bitrate:%"PRId64"\n", diff --git a/libavcodec/mpegvideo_parser.c b/libavcodec/mpegvideo_parser.c index 1204789c67..d0b22634bb 100644 --- a/libavcodec/mpegvideo_parser.c +++ b/libavcodec/mpegvideo_parser.c @@ -233,7 +233,7 @@ FF_ENABLE_DEPRECATION_WARNINGS if (set_dim_ret < 0) av_log(avctx, AV_LOG_ERROR, "Failed to set dimensions\n"); - if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && bit_rate) { + if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && bit_rate && bit_rate != 0x3FFFF) { avctx->rc_max_rate = 400LL*bit_rate; } if (bit_rate && -- 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".