From patchwork Thu Jun 2 00:30:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Anthony Lemieux X-Patchwork-Id: 36040 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:6914:b0:82:6b11:2509 with SMTP id q20csp3739120pzj; Wed, 1 Jun 2022 17:31:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsb9FXHqRO0lBG3HKN45i+XcCClWgFS023ajKCbeL6myqsyYQO9+PHETMiwbi73V234wib X-Received: by 2002:a05:6402:34c4:b0:42d:f0b1:6f1f with SMTP id w4-20020a05640234c400b0042df0b16f1fmr2619770edc.208.1654129887891; Wed, 01 Jun 2022 17:31:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654129887; cv=none; d=google.com; s=arc-20160816; b=ubyPnSNrJCT0Ha+U5BSCttS/wkqYaS24uRCA+Gd7UBShbh4hthUk+sjY1l5oi98hAc fWgec5Rh4Q5KICrReA8x27jLJmZWcsVc1fwzr+B+iEn96MbERBVxdUQyS7AHflLC6b0s a1b+rlCO5CzTJIJWIcFAougOhrQ8TEQzoLLtw1+gGN8AxVE8X9AsI7WpNSMHM/2glFIs x9T4JtnJ8JZYhR+pITyBor8fmYYRZXeWfJmIbJDIx+9Kkf5Q5mVbPykwnM/3/wUsMJG2 EaMZk6cvJimVIYREnOc15b2d7mQuEOVsQxKDYBAbXMC9/+WpWS7go9EYLFRsjoktQMq3 Wd0Q== 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:delivered-to; bh=te9oryQbOG3zeQUR52dXJK8990S8zzufkcbKFlV+sUI=; b=Wt2dvv59GwTqhxC+anAoGF7N2caDPnn6ndLPs6q0BMv8d4d+lRxbQvMPTPBta8uj0V N5gi/Nh1epXPrsSr+XxVzYTZFqo8QZZ4Ias8XK2Mt9c39jEQ+LoI74A+nU01jIBQXZ0f AM69+snmhHs0+yoXtUKoYHyfregHAaBRaw2vq6z/QrqE5X1hCD90z08MxgBmEiuZWrTW 4ADdm9lyO/HTgO8dq5hJNycrf3EsTt3pdqyAQJLi4IjIQCCVJIUmm+6a5769+nZl20tU PCNh0EBjDBpeokbpYbqGyFoEzaFVHgjUGP8jrELkE/krsSEZ8yQGefMHXmRfLknMaBjC wYGg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id s9-20020a056402164900b0042ab7a5cabcsi3346298edx.214.2022.06.01.17.31.27; Wed, 01 Jun 2022 17:31:27 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1126468B7D1; Thu, 2 Jun 2022 03:31:01 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 82BE668B7B9 for ; Thu, 2 Jun 2022 03:30:54 +0300 (EEST) Received: by mail-pj1-f48.google.com with SMTP id l7-20020a17090aaa8700b001dd1a5b9965so3491841pjq.2 for ; Wed, 01 Jun 2022 17:30:54 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=inOmA3C9ICUbIrIDk7VOwMY3IWzQMQ6mpJixCyln1ns=; b=GPCNFhxTJEUIwenjwOkEroZReC0gaxOgCbdJIKjOgLqrMuW5daQfyjA+o7+FMReWUx UcVeSkZiC99b2w8bQD1KgVVgjhebE0gOx50mS3de7JQkaTXN4FVZFQbjp03B2D07/SFH epwbM+DIPts/QxwXfgkugglV36aoK3g5O1yx5aLZwXpHfO0yyxb/tGi1d3vo0NNhJIx6 FtMlyU71VMDlVWUGn1wMK+snrU1e1CJbT72yApxb0B35jnSqvzYxRBYua2QSio7q3NYv G2iJkdrgW+/QMRDkP4DKmIE/zgW2opFFscmiJL+VXpTImh7v2xC6itZ6bmdx+0zLjz6T LDDw== X-Gm-Message-State: AOAM530D7pKe/Fy0N1hgi6u6qHqcTC58K6MNcR2J73/Ze6wShmfh+QMd on90R9rcGUJQES2DbdAs+L1XQzoO5Fk= X-Received: by 2002:a17:90a:bb0e:b0:1dc:a406:3566 with SMTP id u14-20020a17090abb0e00b001dca4063566mr2162535pjr.135.1654129852595; Wed, 01 Jun 2022 17:30:52 -0700 (PDT) Received: from localhost (76-14-89-2.sf-cable.astound.net. [76.14.89.2]) by smtp.gmail.com with ESMTPSA id u188-20020a6279c5000000b0050dc76281aasm2051375pfc.132.2022.06.01.17.30.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 17:30:52 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Wed, 01 Jun 2022 17:30:47 -0700 From: pal@sandflow.com To: ffmpeg-devel@ffmpeg.org Date: Wed, 1 Jun 2022 17:30:35 -0700 Message-Id: <20220602003037.24597-4-pal@sandflow.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220602003037.24597-1-pal@sandflow.com> References: <20220602003037.24597-1-pal@sandflow.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v4 4/6] 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: UCfKNAIbtFyu From: Pierre-Anthony Lemieux --- libavformat/smoothstreamingenc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c index 1713dd9009..ade6d5723b 100644 --- a/libavformat/smoothstreamingenc.c +++ b/libavformat/smoothstreamingenc.c @@ -34,6 +34,7 @@ #include "libavutil/opt.h" #include "libavutil/avstring.h" #include "libavutil/mathematics.h" +#include "libavutil/uuid.h" typedef struct Fragment { int64_t start_time, duration; @@ -416,13 +417,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);