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 EB6E446FE6 for ; Tue, 25 Jul 2023 00:10:11 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 81D8668C812; Tue, 25 Jul 2023 03:10:09 +0300 (EEST) Received: from btbn.de (btbn.de [136.243.74.85]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 63F3D68C02E for ; Tue, 25 Jul 2023 03:10:03 +0300 (EEST) Received: from [authenticated] by btbn.de (Postfix) with ESMTPSA id E1A6C17705B for ; Tue, 25 Jul 2023 02:10:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothenpieler.org; s=mail; t=1690243802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Am1/7oQpl5LN5vPNN2kmEEPELxXEHKCDziMwUiuNO58=; b=DUgJkDu28pF/Oat3HnjgyQl+PXqnz173VOYWpVFPITvKQ/aLLyuq38PZ35kETOG5ScPvVe rg/7AFZs2VhJLykOCkvmB5zV7ebjQzNlIiCANvzkjg8Le3GnubZhnQZR1rTKIsUfFQ9yrb 2HoJT5xaOglW4g/WPiTwo3EpHavO3R3bnKIgBMZjsR2OZyS+Tu0fzgLytoWgsEmUkYN9Os dS7Z7qPsFRSTUjt5mPi4SO8iCVwU+orwMa/LUgzEvlZRgrYHg5ClzBN7d6daXu94tPlv9j hFiDM6c6QP2ffIVBxl4Oalf0hBZyyhwd11uCxyibBsrue2fKJXwIroXuOSgAyg== Message-ID: Date: Tue, 25 Jul 2023 02:10:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 To: ffmpeg-devel@ffmpeg.org References: <20230724234123.1054-1-h.leppkes@gmail.com> Content-Language: en-US From: Timo Rothenpieler In-Reply-To: <20230724234123.1054-1-h.leppkes@gmail.com> Subject: Re: [FFmpeg-devel] [PATCH] flvdec: fix size desync when reading timestamp offsets 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 25.07.2023 01:41, Hendrik Leppkes wrote: > The size offset was previously being accounted for in flv_set_video_codec > for h264 and mpeg4, instead of being directly accounted for in the spot > where its read, which desynced on HEVC streams. > > For clarity, move the size offset directly to the parsing, similar to > how its done for all other header fields. > --- > libavformat/flvdec.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c > index a6a94a4021..3fe21622f7 100644 > --- a/libavformat/flvdec.c > +++ b/libavformat/flvdec.c > @@ -407,11 +407,9 @@ static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream, > case FLV_CODECID_H264: > par->codec_id = AV_CODEC_ID_H264; > vstreami->need_parsing = AVSTREAM_PARSE_HEADERS; > - ret = 3; // not 4, reading packet type will consume one byte > break; > case FLV_CODECID_MPEG4: > par->codec_id = AV_CODEC_ID_MPEG4; > - ret = 3; > break; > default: > avpriv_request_sample(s, "Video codec (%x)", flv_codecid); > @@ -1321,6 +1319,7 @@ retry_duration: > "invalid timestamps %"PRId64" %"PRId64"\n", dts, pts); > dts = pts = AV_NOPTS_VALUE; > } > + size -= 3; > } > if (type == 0 && (!st->codecpar->extradata || st->codecpar->codec_id == AV_CODEC_ID_AAC || > st->codecpar->codec_id == AV_CODEC_ID_H264 || st->codecpar->codec_id == AV_CODEC_ID_HEVC || tested with both h264 and hevc input, works fine _______________________________________________ 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".