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 528BE40B14 for ; Fri, 4 Feb 2022 03:23:51 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3A48568B256; Fri, 4 Feb 2022 05:23:49 +0200 (EET) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1C1A968B00F for ; Fri, 4 Feb 2022 05:23:43 +0200 (EET) Received: by mail-pl1-f169.google.com with SMTP id y17so4009067plg.7 for ; Thu, 03 Feb 2022 19:23:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=np+kifubgbctq6k6PaiMptCI7RLEn+lleUShREJZUFQ=; b=qofV+0l5YtD1HqoTUq/qb9dnQc5H6MsUefSl4IxHmJV3anPQf2H3Urg5fR+W/eIyij XicFpDsh70clxyE4H27y3wrox7CbKe6uqJQMlJPIu9dc/1UoAclvs4P01KVZgwUUJVJE xF5nUCwfL9WqhUVISdIFKXLdiyNF+Mj4Gw4Im3dcjYYWvADzRqy6fn17p7VfpBUcxQ4H KCY1rQ+H8aHylhhh6kIqI7Y2Fb/LUIltWOF2Po/cBBkyG7mZbCsZ0jJ8uDd9BLGIiIII vlaWJj/7R+mjtHf1cefPC4HlFoozOgpteAC2CB069llt3vREAobmuvUpuHYWZcVR9fOu 7JIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to; bh=np+kifubgbctq6k6PaiMptCI7RLEn+lleUShREJZUFQ=; b=AfC9Wmdf/SSGYqL1ZoJ2zapWsOPRPUhoYFAq12hw359EQmw2RO7PVMrn5l6ps4vIBZ Lp8ZEC7IcS2+dGXlpNLCxwYw4Yo7pkHDmkexJWiOHUV46a+arAbvYnZIXyPFdnxDleuG /kLuoevHUQBM5E94Jm6xvnVEwHT2nCUjS7MA2CVZ8slKgFhSzGooi+ykvqcPmEWp5Huk 9KUvavB0kOaeaJuor4DfuuVagRPIZjqo9OcozaPZy+t6wf3SfgRi+zUbC80s1SKGArjL 4TODvbCXoPxdxfwvr9U6X7lKLZmVikuGeAipceyzFqhsq7/IoPGsSu9fSYBzZodfQBr0 0Zsg== X-Gm-Message-State: AOAM532BFuTXG2xIC+YpzzSINpJ6uufnLgFHjecoI6MC/m+2UEUp+hhH e9fsUc5Frrl6l4RPZDAo5rbEtzKFG4E= X-Google-Smtp-Source: ABdhPJzjm0MYmAQLH74lz+V5vd5SZV0Ryo9uUxmRx0Mz9496YWp+EZJkPgu2neXGcj4GU6q6UuFuwA== X-Received: by 2002:a17:90b:3803:: with SMTP id mq3mr894076pjb.95.1643945020688; Thu, 03 Feb 2022 19:23:40 -0800 (PST) Received: from gmail.com ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id h9sm427077pfi.124.2022.02.03.19.23.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Feb 2022 19:23:40 -0800 (PST) Date: Fri, 4 Feb 2022 11:23:36 +0800 From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Message-ID: <20220204032336.GA24526@gmail.com> Mail-Followup-To: ffmpeg-devel@ffmpeg.org References: <20220202204510.1091477-1-patrick.keroulas@radio-canada.ca> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220202204510.1091477-1-patrick.keroulas@radio-canada.ca> Subject: Re: [FFmpeg-devel] [PATCH] avformat/rtpdec_rfc4175: fix interlace format 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 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: On Wed, Feb 02, 2022 at 03:45:10PM -0500, Patrick Keroulas wrote: > In previous state, a new frame was allocated on each timestamp step, > i.e. each frame/field transition. However, for interlace, a new frame > should be allocated on 1st field, completed with the 2nd and finally > freed. > > This commit fixes the frame allocation and the detection of missing RTP > markers. > > Signed-off-by: Patrick Keroulas > --- > libavformat/rtpdec_rfc4175.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > > diff --git a/libavformat/rtpdec_rfc4175.c b/libavformat/rtpdec_rfc4175.c > index 8e73c07838..83abe499f8 100644 > --- a/libavformat/rtpdec_rfc4175.c > +++ b/libavformat/rtpdec_rfc4175.c > @@ -234,20 +234,21 @@ static int rfc4175_handle_packet(AVFormatContext *ctx, PayloadContext *data, > uint8_t *dest; > > if (*timestamp != data->timestamp) { > - if (data->frame) { > + if (data->frame && (!data->interlaced || data->field)) { > /* > - * if we're here, it means that two RTP packets didn't have the > - * same timestamp, which is a sign that they were packets from two > - * different frames, but we didn't get the flag RTP_FLAG_MARKER on > - * the first one of these frames (last packet of a frame). > - * Finalize the previous frame anyway by filling the AVPacket. > + * if we're here, it means that we missed the cue to return > + * the previous AVPacket, that cue being the RTP_FLAG_MARKER > + * in the last packet of either the previous frame (progressive) > + * or the previous second field (interlace). Let's finalize the > + * previous frame (or pair of fields) anyway by filling the AVPacket. > */ > av_log(ctx, AV_LOG_ERROR, "Missed previous RTP Marker\n"); > missed_last_packet = 1; > rfc4175_finalize_packet(data, pkt, st->index); > } > > - data->frame = av_malloc(data->frame_size); > + if (!data->frame) > + data->frame = av_malloc(data->frame_size); > > data->timestamp = *timestamp; LGTM > > -- > 2.25.1 > -- Thanks, Limin Wang _______________________________________________ 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".