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 20CE546B12 for ; Fri, 4 Aug 2023 02:54:31 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7160D68C3F0; Fri, 4 Aug 2023 05:54:28 +0300 (EEST) Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8818468C2E0 for ; Fri, 4 Aug 2023 05:54:20 +0300 (EEST) X-QQ-mid: bizesmtp70t1691117653t5j0y6mf Received: from localhost ( [103.102.203.192]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 04 Aug 2023 10:54:11 +0800 (CST) X-QQ-SSF: 01100000000000Z0Z000000A0000000 X-QQ-FEAT: aBJFcW+uBGYyM1Htye8Wx1/x6otkbZuOzSrwkXBa4ok7yRFPM4cGDs9b90QXR McZhfCKyv8Uh38vp/hgk7mrMi5/Plioh3WoU79l03e7ntxYyl17Z6Q6omqGYC3lifPQuklo D9+Py5/li4pRIvGoGXi/Rg+WY4AekOikorKzszUU/zV0l7ycpPizNmJ/HFQoHipUu0dQ/jH uFhNu9Bkmk0R73GT+Xa0d0o1Mm/eu5tOKvBY4pfmQQlr19MJ1jtRF4a6sX33E/KJ1uQ5na5 JsY0+cauI7KWwB4dR7zO1TkokU6ek/f4cNXEGe4G08TC/53sbjv3UmwDDp243+xzYU/WgcN M+a692XyskJ10Zp8QPmSSthhAZuiN31sk8YHMmo X-QQ-GoodBg: 0 X-BIZMAIL-ID: 4804387600893521159 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Fri, 4 Aug 2023 10:54:09 +0800 Message-Id: <20230804025409.38156-1-lq@chinaffmpeg.org> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:chinaffmpeg.org:qybglogicsvrsz:qybglogicsvrsz3a-0 Subject: [FFmpeg-devel] [PATCH] avformat/flvdec: remove unused context member of flv 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: Steven Liu 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 exheader is unnecessary after 207e9f4e505d969d6ff7545b449295a1b88d6d1c Iust use local varible can do the same function. Signed-off-by: Steven Liu --- libavformat/flvdec.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index bdcf96b4ae..e25b5bd163 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -80,7 +80,6 @@ typedef struct FLVContext { int64_t time_offset; int64_t time_pos; - uint8_t exheader; } FLVContext; /* AMF date type */ @@ -813,7 +812,6 @@ static int flv_read_header(AVFormatContext *s) s->start_time = 0; flv->sum_flv_tag_size = 0; flv->last_keyframe_stream_index = -1; - flv->exheader = 0; return 0; } @@ -1043,6 +1041,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) AVStream *st = NULL; int last = -1; int orig_size; + int enhanced_flv = 0; uint32_t video_codec_id = 0; retry: @@ -1095,9 +1094,9 @@ retry: * Reference Enhancing FLV 2023-03-v1.0.0-B.8 * https://github.com/veovera/enhanced-rtmp/blob/main/enhanced-rtmp-v1.pdf * */ - flv->exheader = (flags >> 7) & 1; + enhanced_flv = (flags >> 7) & 1; size--; - if (flv->exheader) { + if (enhanced_flv) { video_codec_id = avio_rb32(s->pb); size -= 4; } @@ -1276,7 +1275,7 @@ retry_duration: st->codecpar->codec_id == AV_CODEC_ID_AV1 || st->codecpar->codec_id == AV_CODEC_ID_VP9) { int type = 0; - if (flv->exheader && stream_type == FLV_STREAM_TYPE_VIDEO) { + if (enhanced_flv && stream_type == FLV_STREAM_TYPE_VIDEO) { type = flags & 0x0F; } else { type = avio_r8(s->pb); -- 2.40.0 _______________________________________________ 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".