From patchwork Sun Apr 24 10:14:06 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: 35426 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b9e:b0:7d:cfb5:dc7c with SMTP id b30csp1335228pzh; Sun, 24 Apr 2022 03:15:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxScICPfzHgwsMSNSec2pttMDOY27kCBBYsPYPDNEXwUCdyW3vfp/YdeqSsGPr5Digch195 X-Received: by 2002:a05:6402:cac:b0:410:a920:4e90 with SMTP id cn12-20020a0564020cac00b00410a9204e90mr13597254edb.60.1650795300476; Sun, 24 Apr 2022 03:15:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650795300; cv=none; d=google.com; s=arc-20160816; b=H7wwcSQRhdczMSqvJZAlst5zoQqapUZ5Wk5HXARBBMJxaBikX72qx32/4zPm+J1Gki xpkrODIp954TASeU/e0sgFCfp4K6pA1IWwcVNBB0BUYBMxz0MztpMeRZ51QCnPImj7w+ QuofPKCpWDavgVVLeHi0rr8WHf9rZ6HBKpwzeoCzOEFdZakwbu945SQfMS5LhWMNQn7d AcIOWHzUG7kPqYLvdZxsGqB2VMDpCgS90xQkUQ4th59/x7kD8DSZrhdtu30SeJaytOT/ h4WWt+mQ9LldR6oHbtqJ0v8GhPeYrBQfFxNwvVhOyjfPM7Y2YcnYA4aF9bILogg2opRW Xu9A== 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=7lUDMloxbTsgiPBVVWt7soCK5RgI/3l1IbJaQwnYwwk=; b=SbONTJwl8Qs6MyyGNpuno7CEWB3vfqhVvQDNOgr/HrxN6UyW5LhUlGmLdADv0FGp+6 Pzci78gxnva868+QCAs+tuUb83Hqd9z+D1fYe/txH886MMqj5dZWYscoBLMoZ1J1v7j2 EMY1L9OY7TT/i0b3Zdm9NuTjM44DJVTIfahVblGJGMF83iBJ/ATAziICkKBHZaD+0JaB 4yIUXLHhhz2h7N/wlE5vBuCFRW4mVtMl+1LAX+7/0h0PuLStG1ZIm1h/lzNcn1KieCaX E1CiJE8CK8164U3GirkYYAaNhsSRoeOoIscRnwqLp6vWtrpR9hXjZIqqbRn/uCUpfhvA oLQw== 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; 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 s15-20020a056402520f00b0041d96aaabb2si11572660edd.242.2022.04.24.03.15.00; Sun, 24 Apr 2022 03:15:00 -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; 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 AA90E68B23D; Sun, 24 Apr 2022 13:14:43 +0300 (EEST) 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 474B168B06F for ; Sun, 24 Apr 2022 13:14:37 +0300 (EEST) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Zane van Iperen To: ffmpeg-devel@ffmpeg.org Date: Sun, 24 Apr 2022 20:14:06 +1000 Message-Id: <20220424101409.95486-5-zane@zanevaniperen.com> In-Reply-To: <20220424101409.95486-1-zane@zanevaniperen.com> References: <20220424101409.95486-1-zane@zanevaniperen.com> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: cadance.vs49688.net Subject: [FFmpeg-devel] [PATCH v2 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: IxDV/Dc7W5Oi 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 c67f0cba43..3d857b932e 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; @@ -420,13 +421,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);