Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] avformat/flvdec: remove unused context member of flv
@ 2023-08-04  2:54 Steven Liu
  2023-08-14  6:14 ` Steven Liu
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Liu @ 2023-08-04  2:54 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Steven Liu

The exheader is unnecessary after 207e9f4e505d969d6ff7545b449295a1b88d6d1c
Iust use local varible can do the same function.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
---
 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".

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [FFmpeg-devel] [PATCH] avformat/flvdec: remove unused context member of flv
  2023-08-04  2:54 [FFmpeg-devel] [PATCH] avformat/flvdec: remove unused context member of flv Steven Liu
@ 2023-08-14  6:14 ` Steven Liu
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Liu @ 2023-08-14  6:14 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Steven Liu

Steven Liu <lq@chinaffmpeg.org> 于2023年8月4日周五 10:54写道:
>
> The exheader is unnecessary after 207e9f4e505d969d6ff7545b449295a1b88d6d1c
> Iust use local varible can do the same function.
>
> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
> ---
>  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".

applied


Thanks
Steven
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-14  6:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-04  2:54 [FFmpeg-devel] [PATCH] avformat/flvdec: remove unused context member of flv Steven Liu
2023-08-14  6:14 ` Steven Liu

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git