From patchwork Thu Oct 14 13:09:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 31115 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp7146117ioa; Thu, 14 Oct 2021 06:10:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxGi5aFT0w9nmi/46O2cW/Sop702GdPKq2u5rudJgtUcs2PZnKdOyA2ew6mjKaj1pRw9B0 X-Received: by 2002:a17:906:ce45:: with SMTP id se5mr3789188ejb.386.1634217035184; Thu, 14 Oct 2021 06:10:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634217035; cv=none; d=google.com; s=arc-20160816; b=UnrpWMqCqJfgQUYmXpxiZ6SBeILLblh2Ssadedswe7ZVwP7NFVLEwj19CwL7Uns/K6 drHu6khID+QnsRYTVfkCQeHaGXHrKOI0H/tDRiv4FgSpVEKHXN02FgxX0O1YpOEAahfH kIeeydHBPkoMaePV40cdwBqGOM1+YtbZYqHOAEAqf4RM5ND3GjwcCEHziebIW/KEhmrr BQGdkDea6MJQORMiDta587oN5zxKKz4ORrd9AfbxE8K5WuMWB1QjVkc9m/7yZFSwxbGC msijpw1jIG60TITsCH2kT6aKMOElYizvqr42WZYLoC7jYE7Xy6IoGgKsVYb181NXnPKr CEww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=Fv790C6DfebQgshqVggFusgO4eAHuV5FcbxRBVb+nOY=; b=KyoH5AFOMm3Sda+SF1JpkVNuCTMOQqXciIjDkMD3DyTOArOqcYKngXKjKobjBDZf/P AanogmB/HSs2r90l/mITPstG0zVhRd84Jg7kyonwroD7u0L1/aeTFqOWlcgJyYUCSBW3 1DaCg9zxrJPtzkPAEkbNO0QtsUOc8OjE1D9AIsR539h6DSD/bm+L/wC3C7YDtBndfx+V 7LrdJt163g5gK3SnyXVMiZFOAtq9VzsW4OrKYoe6NhhLTQ30OLBk5ZPVEPMit9JXF9vR 4Q6+oKH3VyVSyur0DMxtFD+W+4PeA235IcV+x7jR9sjsJW0q3KxFOxPkcil0B5P6BWXm LXGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=FZHPLCAs; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id q15si3043660edi.437.2021.10.14.06.10.34; Thu, 14 Oct 2021 06:10:35 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=FZHPLCAs; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 687F668AA3C; Thu, 14 Oct 2021 16:09:25 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B0C4168AA4D for ; Thu, 14 Oct 2021 16:09:17 +0300 (EEST) Received: by mail-pg1-f179.google.com with SMTP id 133so5519694pgb.1 for ; Thu, 14 Oct 2021 06:09:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vjGHxLZ0Fe8itfwiUTNBpfhSVKit/HIAUQ+cZ3nayKE=; b=FZHPLCAsSwIYNLYLNzL7QLyA3B9PfgUX4dgfsEDFwdEWlYsiQg6HFOUTHzoS0i2/FK UzOe7RrTYgHnSxliEg1IoHgGPhZQ8eb4adDpYQpcat3/UEAWh3EIsI1b+mPJBCvinyqG h0fC71tgVk3dQn+IB72/3Tv5nBBURuV9MXCujwg0D5rHw+cBvvkBGGeif4dGUThBOCW8 Nj1ZgRW8/kjtwsYNXtYKkaBZaIFfqSCGWslVspA+WTMUSZN4/YW6xgoozKEvD0hcnm8e L7eXToFNZtxWRDgYCKvVd6OTD5OEqdviY2mfcFDLHKVZ3d9cEHHMNKk7/zFcXxyRpFZh cdtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vjGHxLZ0Fe8itfwiUTNBpfhSVKit/HIAUQ+cZ3nayKE=; b=WiQZ2EvAqgfmDcxclT8JOzkxdpiJdqPghp2a0o5GQYorlcYAPA/eXS8U9p5+bjhK3G LVP7e9FzD99UUf01za4Pm4DDC26LrgzOvXoi4a2u67Fqvda+uNpJfxXQNSq7UTtAkhPK HKi7fqAWaLV61fUUx4ml3BS0quWcItWAo0WTJv0zMvlVEkxFcGisXtzZHNk9/rv3UX+p +VuSbmo8hb9vitdzBrFlqHQso4WhNfq6VmerlWg4Jcuvbh6D+bGrBk2v+G6OpZlTpkh6 Qr8H5Ff3bAr6abVP1pee6LCgddWDFdEBdwXJOqbEyUrfl5/yE73+MA12qREIE05r6GBI 5rcw== X-Gm-Message-State: AOAM5309UnlSI7h2RdRzal+ZTm6dDembshesi/zcSqt9YkBjOsxLhgLR Y96NYdtmFt5pv0PAZe513gsW73SEJfo= X-Received: by 2002:a63:c:: with SMTP id 12mr4176474pga.477.1634216956076; Thu, 14 Oct 2021 06:09:16 -0700 (PDT) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id 66sm2504789pfu.185.2021.10.14.06.09.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Oct 2021 06:09:15 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Thu, 14 Oct 2021 21:09:01 +0800 Message-Id: <1634216942-20329-7-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1634216942-20329-1-git-send-email-lance.lmwang@gmail.com> References: <1634216942-20329-1-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH 7/8] avformat/mpegts: Fix for the DOVI video stream descriptor 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: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 0duz8tQ8jn15 From: Limin Wang By <> Signed-off-by: Limin Wang --- libavformat/mpegts.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 44d9298..774964d 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -2178,6 +2178,8 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type AVDOVIDecoderConfigurationRecord *dovi; size_t dovi_size; int ret; + int dependency_pid; + if (desc_end - *pp < 4) // (8 + 8 + 7 + 6 + 1 + 1 + 1) / 8 return AVERROR_INVALIDDATA; @@ -2193,7 +2195,11 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type dovi->rpu_present_flag = (buf >> 2) & 0x01; // 1 bit dovi->el_present_flag = (buf >> 1) & 0x01; // 1 bit dovi->bl_present_flag = buf & 0x01; // 1 bit - if (desc_end - *pp >= 20) { // 4 + 4 * 4 + if (!dovi->bl_present_flag && desc_end - *pp >= 2) { + buf = get16(pp, desc_end); + dependency_pid = buf >> 3; // 13 bits + } + if (desc_end - *pp >= 1) { // 8 bits buf = get8(pp, desc_end); dovi->dv_bl_signal_compatibility_id = (buf >> 4) & 0x0f; // 4 bits } else { @@ -2210,12 +2216,13 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type } av_log(fc, AV_LOG_TRACE, "DOVI, version: %d.%d, profile: %d, level: %d, " - "rpu flag: %d, el flag: %d, bl flag: %d, compatibility id: %d\n", + "rpu flag: %d, el flag: %d, bl flag: %d, dependency_pid: %d, compatibility id: %d\n", dovi->dv_version_major, dovi->dv_version_minor, dovi->dv_profile, dovi->dv_level, dovi->rpu_present_flag, dovi->el_present_flag, dovi->bl_present_flag, + dependency_pid, dovi->dv_bl_signal_compatibility_id); } break;