From patchwork Fri Sep 27 09:46:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul B Mahol X-Patchwork-Id: 15327 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 80AD944A53B for ; Fri, 27 Sep 2019 12:46:56 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 50E3F689953; Fri, 27 Sep 2019 12:46:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2E292689945 for ; Fri, 27 Sep 2019 12:46:50 +0300 (EEST) Received: by mail-wr1-f66.google.com with SMTP id r3so1965797wrj.6 for ; Fri, 27 Sep 2019 02:46:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=RYFPpbR8GIUtYH4Isci2LwY40E2R0M2VpmhqOJGthxU=; b=ZKDG7CMm8ul+od7G3HkseycqPFKVX15Mr17Aliu/R1GPvob/4VCyiBDPQWDhYxQzzM iuiuBz0P+/nhQSs/AN7DZDYtk8WFeinsH0xdBcNPummVEsTvrvkzOUMDWHIYQJrEcci2 oXYAFhS+dbN3gxsyoy3b2p/+/QfU0zMmzD92bg3w7O2irOmq0lTPrEz/NHLgqluCd5Le hG/E/cQOT11ttmxF6UsNtZFUQ/2ifSpb4vfx3sf01rrLZ7mAvz0utQX/hm0h5duwYC46 T1VkxG0qJ8gXyoqobuGqwBDM5bqiA4Muckg2KsD4Xngk85fDuZvRnc4JTe891IOMvim7 hQkA== 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; bh=RYFPpbR8GIUtYH4Isci2LwY40E2R0M2VpmhqOJGthxU=; b=OEcDWK/QA+dQv2JBGC1Wr4k+YXFQX2v/qxq8KK3C4UFT/+PIIYdEpBdPrKKd2ROyt5 XtVev0Ei1E1ww22k7ih+3oRM3+LJtP3/j+NJf+wGI6mUlVH6bDXymRlB+IjW0aOHK352 TaKWRMcVkkaF6A+W5YNk1eELd++M32DXXUdPTZv/c2emQkWu2JBflJP/pudWasiTWs0H S7avAke/bkap3kHYyUS5VzOxrcnPn+3Gm7o2Bttk1Vck5tGwBy7/jEjxYUx+WdqSM5pX LVpjZ2ESzE4H4zd01IOlbVLedwlrkVr1mv+rMVhszUO5zlu//FcOdhfDs64C97Y9X+GL W2kw== X-Gm-Message-State: APjAAAU74E49/V8VwEuu1M2DgJXhWOR+4rfBCMD519u7BGroBayasbrT PeSHgCPf0biAWox4MV1pN+8dcoxu X-Google-Smtp-Source: APXvYqxEfBTMHB7vozsrw9y7v+O6vuL2apo0n8CYtIFlsLz+IiJ0eg9vKV+QwDcyMXuK9Z6st37e5Q== X-Received: by 2002:adf:84c6:: with SMTP id 64mr2410804wrg.287.1569577609282; Fri, 27 Sep 2019 02:46:49 -0700 (PDT) Received: from localhost.localdomain ([109.227.33.147]) by smtp.gmail.com with ESMTPSA id e18sm3308736wrv.63.2019.09.27.02.46.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2019 02:46:48 -0700 (PDT) From: Paul B Mahol To: ffmpeg-devel@ffmpeg.org Date: Fri, 27 Sep 2019 11:46:39 +0200 Message-Id: <20190927094639.25111-1-onemda@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH] doc/examples/muxing: fix underflow in duration of encoded streams 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Now they are exactly 10 seconds long. Fixes #5684. Signed-off-by: Paul B Mahol --- doc/examples/muxing.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c index 08da98e574..9af9aae483 100644 --- a/doc/examples/muxing.c +++ b/doc/examples/muxing.c @@ -285,7 +285,7 @@ static AVFrame *get_audio_frame(OutputStream *ost) /* check if we want to generate more frames */ if (av_compare_ts(ost->next_pts, ost->enc->time_base, - STREAM_DURATION, (AVRational){ 1, 1 }) >= 0) + STREAM_DURATION, (AVRational){ 1, 1 }) > 0) return NULL; for (j = 0; j nb_samples; j++) { @@ -464,7 +464,7 @@ static AVFrame *get_video_frame(OutputStream *ost) /* check if we want to generate more frames */ if (av_compare_ts(ost->next_pts, c->time_base, - STREAM_DURATION, (AVRational){ 1, 1 }) >= 0) + STREAM_DURATION, (AVRational){ 1, 1 }) > 0) return NULL; /* when we pass a frame to the encoder, it may keep a reference to it