From patchwork Tue Feb 22 13:01:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zane van Iperen X-Patchwork-Id: 34447 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:d078:0:0:0:0 with SMTP id x24csp4327600nkx; Tue, 22 Feb 2022 05:03:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZEDl5f/vLxe9xltaFe/FYCWBWAih1WKUMqR7JAqL0ktcLYFvqYFpLkh89PLkE2Y7ajEXt X-Received: by 2002:a05:6402:27ca:b0:410:1249:7c85 with SMTP id c10-20020a05640227ca00b0041012497c85mr25841225ede.192.1645534997593; Tue, 22 Feb 2022 05:03:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645534997; cv=none; d=google.com; s=arc-20160816; b=Y7cVFEn/fuI4TgmEkWhsOOoTUn3tuJEWatg1McIsdeqaN9fY8GUulUFeUgkW4HMP95 dMnLWT+hI4B/2j3W4mjAAPuumyEofglWbaxUeKTvvEb/Ag/9k0lfeuyj+doNDh/SDpUA fkKNcGqXYP0x8Ho0plLjPzSnMM65u+4MSwwM6ZE20UGZTuS3zRQhHYUn8Ci2YU6w0KFF RnxeAFU2z2i9mxFRHvBqw28e/6/mZ9QK08S0b1yriUs166kCGWfX1yqyga4ZpHNsccHI +q5uBWh/4VKc7LXvSuPSiDJyr1YSNtJIMkjK/lx2V3EzCQLDqhCe2fNlJDnqqJ/H6YHk f/sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=hcHXCh3PO2v0c1KgigxLc/mWmxC9NHU1NAFi2QDcAAY=; b=vvnHcg5MktC0o3z9776sTKlvFDKlvDHCQxMDfhFpQ9qfAVX1xPfggF0whA+OCY22Zm 6jU0yWyTSAfOraQadcfbaguJH22ATyObysupj38amfAXk9M8A4GMqaVUbDbIfjYBNvgC G1UKOlmsDH3xBtIFilyiYE5mjVmXc3ZktoZYOIELg7CsXjKy9xOzKPgjZ6Wjbm7YRKJ9 j/llAvdtLf97QjGefKCj1btR2X8KL1V8Iq2V5vzr+j2Uc8P+Yu+o8WyU9VpZKWCQiNyJ 15z11oy+rQzx+eiPkiRQUpytT8FKUaAmUkBNO/qGy4CiKeL//PpXhl14A92w+kwxl9hU XkDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@zanevaniperen.com header.s=key1 header.b=T7c5wGYC; 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=NONE dis=NONE) header.from=zanevaniperen.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id v9si6365391edb.583.2022.02.22.05.03.17; Tue, 22 Feb 2022 05:03:17 -0800 (PST) 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=@zanevaniperen.com header.s=key1 header.b=T7c5wGYC; 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=NONE dis=NONE) header.from=zanevaniperen.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1187B68B122; Tue, 22 Feb 2022 15:02:33 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C91F7689EA6 for ; Tue, 22 Feb 2022 15:02:25 +0200 (EET) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zanevaniperen.com; s=key1; t=1645534945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YjyMqlRXbtdgbolLj/I7oN0SK1vJI4Wze2yFL/HjZFw=; b=T7c5wGYCgYZ1ylglKv9j2copNkvuvHgRYC9S9dvasHnuEluF87M9Vl1JX8gNu2HGAyhHTS zZUtxcqslEsVaCfNVwQG+vnJF5om/U28YyEbT/brYqo5fYXeGm4LfssctOMB2mUTU0Qa8e 6Gk10tXe6tcBWeF/qAZQDHKNamf2LuB+AL/j/kbfUI+9GeAU1v+08az8tOssmBxijfssdt jxtx/a98TKVAYzjQ+Z6RmRyLpXDwg4Oqmr3y+tJh1pEwgdW5obCdvsO6hPfkXCZxXXVO/z 0ljBXT2jcXQH/MrigoZ95y0tES6mv7e06ZKDK/P42GYqjlQ6WM6xgSPFLesnIw== From: Zane van Iperen To: ffmpeg-devel@ffmpeg.org Date: Tue, 22 Feb 2022 23:01:50 +1000 Message-Id: <20220222130153.289215-5-zane@zanevaniperen.com> In-Reply-To: <20220222130153.289215-1-zane@zanevaniperen.com> References: <20220222130153.289215-1-zane@zanevaniperen.com> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: zanevaniperen.com Subject: [FFmpeg-devel] [PATCH 4/7] avformat/smoothstreamingenc: refactor to use avutil/uuid 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: Pierre-Anthony Lemieux Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: hCUYSe+veB4I From: Pierre-Anthony Lemieux Signed-off-by: Pierre-Anthony Lemieux Signed-off-by: Zane van Iperen --- libavformat/smoothstreamingenc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c index a0ea5b8fa8..6c36ae2eaa 100644 --- a/libavformat/smoothstreamingenc.c +++ b/libavformat/smoothstreamingenc.c @@ -38,6 +38,7 @@ #include "libavutil/file.h" #include "libavutil/mathematics.h" #include "libavutil/intreadwrite.h" +#include "libavutil/uuid.h" typedef struct Fragment { int64_t start_time, duration; @@ -418,13 +419,13 @@ static int parse_fragment(AVFormatContext *s, const char *filename, int64_t *sta if (len < 8 || len >= *moof_size) goto fail; if (tag == MKTAG('u','u','i','d')) { - static const uint8_t tfxd[] = { + static const AVUUID tfxd = { 0x6d, 0x1d, 0x9b, 0x05, 0x42, 0xd5, 0x44, 0xe6, 0x80, 0xe2, 0x14, 0x1d, 0xaf, 0xf7, 0x57, 0xb2 }; - uint8_t uuid[16]; + AVUUID uuid; avio_read(in, uuid, 16); - if (!memcmp(uuid, tfxd, 16) && len >= 8 + 16 + 4 + 16) { + if (av_uuid_equal(uuid, tfxd) && len >= 8 + 16 + 4 + 16) { avio_seek(in, 4, SEEK_CUR); *start_ts = avio_rb64(in); *duration = avio_rb64(in);