From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 7483B4013F for ; Fri, 3 Mar 2023 21:08:41 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3C06A68BA7A; Fri, 3 Mar 2023 23:08:30 +0200 (EET) Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1852968B5A9 for ; Fri, 3 Mar 2023 23:08:22 +0200 (EET) Received: by mail-qv1-f51.google.com with SMTP id nv15so2647130qvb.7 for ; Fri, 03 Mar 2023 13:08:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ltnglobal-com.20210112.gappssmtp.com; s=20210112; t=1677877700; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ycgax3oW1DYgug24+ybNqPPwJ+WSNv+LpSok9HP0hd4=; b=Me4pApb0qSzFmobAe5az0j3Eg0IrGUZwON0wnhpsBz+rFLhLg4STBXyqhjtTmKBIt6 evvFrvWa5F8oQluaTSfKQzgCFOcHeoogF832SjGGrKv6kw+VHaJuen7/GwL2ZHduof/w L5h4/IOEx3OYic3QMDrXpxr8g1vPXIDkp4X6VLm001NBbp1eBlEDabQu0FQXRt5o+Qi3 HPIooLjaO47fOLrO+0uoN0CYnEYrbA+PUA9YzCM68JOl2ST/TdQEu9UpkSXSlQJX+dwS e4ATTpRLQ/eCXIWb6StT+WrCl6WSxUlTDz21yDYGo7c3ynLhN8hXfcqGK5RxNU8KSI1r XiWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677877700; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ycgax3oW1DYgug24+ybNqPPwJ+WSNv+LpSok9HP0hd4=; b=WW+SAQtKWvGjQSl5jUfrmDMnkAcNy6xdqM0//0/TvTXO56Tk9mFTwVeQah2wCuUhQf 6wSd01M4XEhvIPbCTJKvxUvFk3MGIsESoMw/Zjau6f/ML2rKN9gMFQ8qLN+ClOP3wDhI W0uzpiUcYAxqOLZuKsudfA52zMdsRTy86A7iroTdBmQYsCSPYyp8FroewI6TVpkXR+Os 8mledrFHRj+g/mwu4Kx96nFYnFBydBXuDZaBdfKaM87tiCbMYIyu8tGlelGWoqc7fA83 Ajoy4LrUkDEfg/nKyQrfQ7wEVEBJq2yMJ945Mpzpzta3Svy+DrWD6dNVueA5rXSnrZy0 morw== X-Gm-Message-State: AO0yUKVoBmSNtCebIT+MryYHTCYCEoqhWSKtoN64sxxZIehiE0mfgsVp 8ddDQdnbwOfQ6zdbCJF+1mxkYS6HWV/eI1VbsJU= X-Google-Smtp-Source: AK7set/6HROk3W0fJ7OyiqN2ziVgINz1Jw+64N6LbtPF+E116LMpdHbaQR9G63hn+jaL2rzly7Gp6w== X-Received: by 2002:a05:6214:d49:b0:56e:ab08:670b with SMTP id 9-20020a0562140d4900b0056eab08670bmr5904209qvr.34.1677877700664; Fri, 03 Mar 2023 13:08:20 -0800 (PST) Received: from klab-nyc-kernellabs2.localdomain (pool-71-105-132-214.nycmny.fios.verizon.net. [71.105.132.214]) by smtp.gmail.com with ESMTPSA id e10-20020a05620a014a00b0071a02d712b0sm2442991qkn.99.2023.03.03.13.08.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Mar 2023 13:08:20 -0800 (PST) From: Devin Heitmueller X-Google-Original-From: Devin Heitmueller To: ffmpeg-devel@ffmpeg.org Date: Fri, 3 Mar 2023 16:08:14 -0500 Message-Id: <20230303210815.23692-2-dheitmueller@ltnglobal.com> X-Mailer: git-send-email 2.35.1.655.ga68dfadae5 In-Reply-To: <20230303210815.23692-1-dheitmueller@ltnglobal.com> References: <20230303210815.23692-1-dheitmueller@ltnglobal.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 2/3] decklink: Fix setting of last_pts to only be set for video 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: Devin Heitmueller Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: The ff_decklink_write_packet() was always caching the last pts received, to be used when calling StopScheduledPlayback(). However because audio and video are on different timebases and the call to StopScheduledPlayback() expects the video timebase, we'll end up sending a weird value to the stop routine if the last packet received contained audio. Move the setting of last_pts to just be for the video stream. Signed-off-by: Devin Heitmueller --- libavdevice/decklink_enc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavdevice/decklink_enc.cpp b/libavdevice/decklink_enc.cpp index 5a435ddc78..573b9e687c 100644 --- a/libavdevice/decklink_enc.cpp +++ b/libavdevice/decklink_enc.cpp @@ -441,6 +441,8 @@ static int decklink_write_video_packet(AVFormatContext *avctx, AVPacket *pkt) uint32_t buffered; HRESULT hr; + ctx->last_pts = FFMAX(ctx->last_pts, pkt->pts); + if (st->codecpar->codec_id == AV_CODEC_ID_WRAPPED_AVFRAME) { if (tmp->format != AV_PIX_FMT_UYVY422 || tmp->width != ctx->bmd_width || @@ -629,8 +631,6 @@ int ff_decklink_write_packet(AVFormatContext *avctx, AVPacket *pkt) struct decklink_ctx *ctx = (struct decklink_ctx *)cctx->ctx; AVStream *st = avctx->streams[pkt->stream_index]; - ctx->last_pts = FFMAX(ctx->last_pts, pkt->pts); - if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) return decklink_write_video_packet(avctx, pkt); else if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) -- 2.35.1.655.ga68dfadae5 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".