From patchwork Thu Aug 9 15:48:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasi Inguva X-Patchwork-Id: 9948 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:104:0:0:0:0:0 with SMTP id c4-v6csp2365225jad; Thu, 9 Aug 2018 08:56:54 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzrryARwIUtlvjfZUCTeBCkloW5+XZrNUYy+UwSL7aZ9tNCztSbUmLLyyjRDiQZwUWM+NiR X-Received: by 2002:adf:e287:: with SMTP id v7-v6mr1909599wri.139.1533830214666; Thu, 09 Aug 2018 08:56:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533830214; cv=none; d=google.com; s=arc-20160816; b=0U/xOfgA+qdcRqvjwRFemrN9RBORs9bEj2uOITv8u+YVzK3QOdq7vrAYoRrMIeBpg0 LebRbjgCP7D6pPdEpFhguYu0yXODeHWJXUy8I8Tflu20ccu8YWwExqdcWDAVnLbfL2Im 7/KscjnP/IwLxuBDUCGjGIxu2zPfzw/aatvtAew9yRbun/ItRtfdxBhaAy8WsOBtkuEN qLYBAuyD9qlHelREHB1pDwN7Z4hUkeeQ574gGc1fRq+GvJ078K0SGeRQ+mkCnkCDyd3+ ATEaS0cRb6xkrTF4RF6lA1R5AUaLP9sVN1zWot+dmqKxn9iGZeBYkziw1u39/Ud8v/Ow L4fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:in-reply-to:references:mime-version :dkim-signature:delivered-to:arc-authentication-results; bh=V+13b1AVm6aRUmIiOEDBW5LLbVE6axT6HoAqD4VacVg=; b=cxLTiu5vcQ3ku4ehcZrtWfFnCe9QW4u9odMoOU0NFYTp543+1ID4zDu1uqGMvaex6F XjKEbfaWOBKyCorEBlnv8Q4ubh7LWjOhRguZw6mI2dAmnmd5izFy6wzrw4Z6/GjAbyEp cE57DtLICorDl1y28nKKwBA++1t/qhhFZKb9ywyHeFo0J+WH0ufHJrEg7ZeCwWPK8q+0 koJdFNs56grh8gPDADQ+H5viymwJkw9ah1KLQdS91/2vfedhXNnUaw6ENbKRByqpiKih glHEHTkQJRoD5dK7VUmd7Oz+qEMpP1TwvWXKdY3sGAOaWSW0PjMUcYbPXg5N4xS+hLaO FTbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com header.s=20161025 header.b=fSFXdKrv; 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 v12-v6si4979792wrq.302.2018.08.09.08.56.54; Thu, 09 Aug 2018 08:56:54 -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=@google.com header.s=20161025 header.b=fSFXdKrv; 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 5073E68A180; Thu, 9 Aug 2018 18:56:31 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BBBFE68A180 for ; Thu, 9 Aug 2018 18:56:24 +0300 (EEST) Received: by mail-wm0-f66.google.com with SMTP id o11-v6so702782wmh.2 for ; Thu, 09 Aug 2018 08:56:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=o/JAn/K2EtaEwCeug+EYSDPb6IDZ72nGZnKmUTe8brA=; b=fSFXdKrvLeIdgd1gbLMgG7zs/HlLUckBzpxwoy3mD244qQtXZdmdfVIw2l6dFycHUR Db89yJpVMB4k6i9J9UgIGQjfNHqIH5XWOn0KQRBxY30K/4bIhEjkGV+CwlGhwMv8q4bG iWhffiwTqWqGzCbR98J1SXEkau7lumoxbfuzBlAyIKx3wYnVByxKuR/yOOUuj8rFajcZ XREC0WAtzy7jHadAo7ykeg13d7GhFZl1suxxYP81xJt1eGem2QP3DIW1AZe+WQK5AxE9 zXI1ENGZVtYpQft43WZYsD24G+Dw3T1iCiwXRkThQ03D7K9Oy6sKaH/ZT0KqN615AQ1x LRGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=o/JAn/K2EtaEwCeug+EYSDPb6IDZ72nGZnKmUTe8brA=; b=uj3XrH2Al9H4VAPKYlxN5dM2sRi9m9D9QA8ELJWgeerypv6wa4VUIQw+TnwotpRrKa CG9KMzuFKfc4x8pDlqhdJwYebcvcbmBaurwQCoD2qYlJgbGBrfxkb5S96gMkhToKZSqe VgDTyAQsN8spXgiYzIAi6Rsi3u91KlPro5XbQWL90w/uy4sWO3Vku1/vE+tYMxZEpKw4 PAVn7a7+nk6EMrwgEBXTT/R/AZC/CsvtZaBCNW5QcG7jghNMiWHK7tvB+5KG2v1vTurR R00sOJBlkvuHtU3XqOIGxEzDfhw9ffZASUAji2KfUE6y+6YJ042BJY9hMoItT4XFkhee vK5g== X-Gm-Message-State: AOUpUlF977HAEe01rjcEDx1XKVtEdasG560eSfkgzCZJ0yDRb/r2vkQa qFVx08p9G2YixlWJaplQYLdKwbl4HBac7AJCivY9rEkWjV4= X-Received: by 2002:a1c:30d2:: with SMTP id w201-v6mr1881198wmw.47.1533829738216; Thu, 09 Aug 2018 08:48:58 -0700 (PDT) MIME-Version: 1.0 References: <20180809002642.26535-1-isasi@google.com> <20180809125928.GD19305@sunshine.barsnick.net> In-Reply-To: <20180809125928.GD19305@sunshine.barsnick.net> From: Sasi Inguva Date: Thu, 9 Aug 2018 08:48:46 -0700 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Set start_time for all sterams (in case of edit lists). 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" Thanks. Attaching the corrected patch On Thu, Aug 9, 2018 at 5:59 AM Moritz Barsnick wrote: > > [PATCH] lavf/mov.c: Set start_time for all sterams (in case of edit > lists). > ^ streams > > Moritz > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > From a0da82579a1c9ebb81bd029750fa718fa5f1c152 Mon Sep 17 00:00:00 2001 From: Sasi Inguva Date: Mon, 6 Aug 2018 16:28:50 -0700 Subject: [PATCH] lavf/mov.c: Set start_time for all streams (in case of edit lists). Fixes vorbis mp4 audio files, with edit list specified. Since st->skip_samples is not set in case of vorbis , ffmpeg computes the start_time as negative. Signed-off-by: Sasi Inguva --- libavformat/mov.c | 4 ++-- tests/fate/mov.mak | 5 +++++ tests/ref/fate/mov-neg-firstpts-discard-vorbis | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 tests/ref/fate/mov-neg-firstpts-discard-vorbis diff --git a/libavformat/mov.c b/libavformat/mov.c index 82cd410a72..c0f90edef7 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -3684,9 +3684,9 @@ static void mov_fix_index(MOVContext *mov, AVStream *st) st->index_entries[i].timestamp -= msc->min_corrected_pts; } } - // Start time should be equal to zero or the duration of any empty edits. - st->start_time = empty_edits_sum_duration; } + // Start time should be equal to zero or the duration of any empty edits. + st->start_time = empty_edits_sum_duration; // Update av stream length, if it ends up shorter than the track's media duration st->duration = FFMIN(st->duration, edit_list_dts_entry_end - start_dts); diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak index 6f0e28d21e..3d9e4280bb 100644 --- a/tests/fate/mov.mak +++ b/tests/fate/mov.mak @@ -19,6 +19,7 @@ FATE_MOV = fate-mov-3elist \ fate-mov-stream-shorter-than-movie \ FATE_MOV_FFPROBE = fate-mov-neg-firstpts-discard \ + fate-mov-neg-firstpts-discard-vorbis \ fate-mov-aac-2048-priming \ fate-mov-zombie \ fate-mov-init-nonkeyframe \ @@ -89,6 +90,10 @@ fate-mov-bbi-elst-starts-b: CMD = framemd5 -flags +bitexact -acodec aac_fixed -i # Makes sure that the stream start_time is not negative when the first packet is a DISCARD packet with negative timestamp. fate-mov-neg-firstpts-discard: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries stream=start_time -bitexact $(TARGET_SAMPLES)/mov/mov_neg_first_pts_discard.mov +# Makes sure that the VORBIS audio stream start_time is not negative when the first few packets are DISCARD packets +# with negative timestamps (skip_samples is not set for Vorbis, so ffmpeg computes start_time as negative if not specified by demuxer). +fate-mov-neg-firstpts-discard-vorbis: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries stream=start_time -bitexact $(TARGET_SAMPLES)/mov/mov_neg_first_pts_discard_vorbis.mp4 + # Makes sure that expected frames are generated for mov_neg_first_pts_discard.mov with -vsync 1 fate-mov-neg-firstpts-discard-frames: CMD = framemd5 -flags +bitexact -i $(TARGET_SAMPLES)/mov/mov_neg_first_pts_discard.mov -vsync 1 diff --git a/tests/ref/fate/mov-neg-firstpts-discard-vorbis b/tests/ref/fate/mov-neg-firstpts-discard-vorbis new file mode 100644 index 0000000000..2e295e3b68 --- /dev/null +++ b/tests/ref/fate/mov-neg-firstpts-discard-vorbis @@ -0,0 +1,3 @@ +[STREAM] +start_time=0.000000 +[/STREAM] -- 2.18.0.597.ga71716f1ad-goog