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 A714440BB2 for ; Sat, 5 Feb 2022 03:46:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E872868B2F0; Sat, 5 Feb 2022 05:46:42 +0200 (EET) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4D02868AFBA for ; Sat, 5 Feb 2022 05:46:36 +0200 (EET) Received: by mail-pj1-f45.google.com with SMTP id h12so7406110pjq.3 for ; Fri, 04 Feb 2022 19:46:36 -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=suT8bO77jVEd5ajIKQ8ygrQ/3PbHJ+MvUBDiGzcF2rM=; b=f+dYZyTb9tyiXxBFGMEi6waScuppd56CmXgUOd3YL1rKRBI02hRHgqle46TVlNsz0R EMHlDk7fWvhPUKGnk31Wm0bRi6bveh8F5CDCdlhy7XmRx4d5pPjd0ohAtTvsPDLpFAgU LpYNu7aidQm3PwXU6B2I1j6At5dksxlunyEgXXynGzTVB18ZILOgFRueuNCFZgfYNzH7 PWCL8qbVTGuOQEMTQEKFxGyu6YtXn8nb18TPmU/a1k5R+3oRitRJuFaEJJsSGsG8760E q33oJDg7U9lz6ARsuKhVHptnvn7M5pB+ayLYyM+r/mZDIX3LuVB+z4IYkWkZUIEUekY4 FlYA== 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=suT8bO77jVEd5ajIKQ8ygrQ/3PbHJ+MvUBDiGzcF2rM=; b=X0hRA1up0Gs22RWJMQImulZ+3KHz3FDaesQbiO8kz2YnjjOvgAP+pX2Vz4HkSF7Ymb 4erYCMCdjyaDs7UKsJk+juqZ6jjUK7ovK8xWViE+AP3e1nVW14PiRJQQDLesfXi85mjc K14t8nQdQ05VZQzQ3dfoKoPWtJUItSG9aJrUOktSHmaLCnQwhY+B2Oq8V/6XrKdLEvkD m0Kg+g37AduLWDx9VO+PhVI5AxUdLRLnmnsRxkIjRJi/RHAlHmV6GP46yb6PI2bMysxd +tXFJ7vH5NrPluylY899sIh1hTCFONloIAs4k34gfxuaRp7ULS8VRPZFRpCZ/vyS6Q2B j5Zg== X-Gm-Message-State: AOAM530nimtGbQWb/9XgrQ+AmhGHgJqzqMzAmUWRDUOae2GFUr9GqsCb zn1rTJRNmpDZhgKgrzQlQbiZJ1rz1I0= X-Google-Smtp-Source: ABdhPJyX8OMs43TlO5Ds/XNvm+1GphjmO7UJWwqmWn8NujI8EC6JVTNFGPjRbmDMIpCHjCHTe7BYtQ== X-Received: by 2002:a17:902:c206:: with SMTP id 6mr6631844pll.46.1644032794096; Fri, 04 Feb 2022 19:46:34 -0800 (PST) Received: from gmail.com ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id c5sm3946839pfc.12.2022.02.04.19.46.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Feb 2022 19:46:33 -0800 (PST) Date: Sat, 5 Feb 2022 11:46:30 +0800 From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Message-ID: <20220205034630.GA9447@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; > > -- > 2.25.1 > applied, thanks. -- 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".