From patchwork Sun Jan 13 17:17:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vittorio Giovara X-Patchwork-Id: 11723 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 5C59244DAA1 for ; Sun, 13 Jan 2019 19:17:38 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7B6E5689C5E; Sun, 13 Jan 2019 19:17:26 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BC09F6899F9 for ; Sun, 13 Jan 2019 19:17:19 +0200 (EET) Received: by mail-qk1-f193.google.com with SMTP id g125so9331444qke.4 for ; Sun, 13 Jan 2019 09:17:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=b/USjGs10YdjjeHYQvahOrdhRZrcpBYBAd6Ya+UJFKQ=; b=MSh6eX3ZTjgFJ2BeuscO32dKRbjCwTFS0hqK0S9fcite/dzhp2ZGw3qm3HLHQTbKa7 wwA8nnooZwWvpGsGI6F6Wx0Wopc1eMiDAPUklfNAtU3qQh7poz9G4Xj/+O3Uj3tRqPHR vBq8I66a+7Grwf4wclmeqBJVmGGyHO47rjlQZRZa9aCEFMq7maR3vcVCLc56ZU4zyCqx kO3hX5OGj6GLXGl0SVvhg6jIvO129oM43cnGG8oIQaHXfFQqACyjFQO9Ro89wxHHwo9t HIlojLiuUTUK9Cy7lYlEzbx+HOirAw5drQwckouh+SVKuf1Y0yPEMgvD1KmGNVIDPzwt OoNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=b/USjGs10YdjjeHYQvahOrdhRZrcpBYBAd6Ya+UJFKQ=; b=VWxukQB2VXBv9hB878bao53mN07q6O9gS7O0+emNUpM2daHdpYmbhC3U4LB8qrRnSf 2Ky3gdQF7IJW0iachdv+cr6e6yKsfWHyIjzAtiWKsEZaq80hX44+UE59l5+glbn+/2ms D5NTj7uftwHSHIw5e2hC9v7nnin2+gV5C5PJdkc8PnjhyVc3IGEoDFOrwz0gt2yOC6IV GYEzkxS99CbS5LwkEf+00G2Sw1w7TDjpI/2o08ti6FF6IDVnq+sr0kSw8UJX9ayryy2U DjPxu3TgvjUePyX1L3KmjenA8c9G+KZcWHwSYxk014q9dnxTN0/ltKD4iRV2KDzyGsHB ilYw== X-Gm-Message-State: AJcUuke7OY9cx7n/ouYJA/NoefZ3mzDTTMBvRZV1v2eU7QnEPcxp6b/m m38BkVX3YinnJpWcOqi9xWlpHL4H X-Google-Smtp-Source: ALg8bN5hMEvp6d5+eVw9V8onXG15nQgxAo8qsEaSzBIt14iA84SMI5LGh5JjKLQf+bJ6GcsAoKo9qw== X-Received: by 2002:ae9:f40b:: with SMTP id y11mr19677944qkl.228.1547399851727; Sun, 13 Jan 2019 09:17:31 -0800 (PST) Received: from vimacnew.nyc.rr.com (cpe-72-227-129-191.nyc.res.rr.com. [72.227.129.191]) by smtp.gmail.com with ESMTPSA id i33sm39616998qtb.97.2019.01.13.09.17.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Jan 2019 09:17:30 -0800 (PST) From: Vittorio Giovara To: ffmpeg-devel@ffmpeg.org Date: Sun, 13 Jan 2019 12:17:24 -0500 Message-Id: <20190113171724.61410-1-vittorio.giovara@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] matroskadec: Adjust content light side data check X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" While in practice both fields are always initialized, this mimics what other tools like ffms2, and x265 do more closely. This work has been sponsored by Tyrell Corporation, for a compensation of dozen of cents of US dollars. --- libavformat/matroskadec.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 4ad99db7db..3ff3516c24 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1877,7 +1877,7 @@ static int mkv_parse_video_color(AVStream *st, const MatroskaTrack *track) { avcodec_chroma_pos_to_enum((color->chroma_siting_horz - 1) << 7, (color->chroma_siting_vert - 1) << 7); } - if (color->max_cll && color->max_fall) { + if (color->max_cll || color->max_fall) { size_t size = 0; int ret; AVContentLightMetadata *metadata = av_content_light_metadata_alloc(&size); @@ -1891,6 +1891,9 @@ static int mkv_parse_video_color(AVStream *st, const MatroskaTrack *track) { } metadata->MaxCLL = color->max_cll; metadata->MaxFALL = color->max_fall; + av_log(NULL, AV_LOG_INFO, "Content Light Level Metadata, " + "MaxCLL=%d, MaxFALL=%d", + metadata->MaxCLL, metadata->MaxFALL); } if (has_mastering_primaries || has_mastering_luminance) { @@ -3552,6 +3555,8 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index, AVStream *st = s->streams[stream_index]; int i, index, index_min; + flags ^= AVSEEK_FLAG_ANY; + /* Parse the CUES now since we need the index data to seek. */ if (matroska->cues_parsing_deferred > 0) { matroska->cues_parsing_deferred = 0;