diff mbox series

[FFmpeg-devel,4/17] avformat/segment: Don't set extradata size twice

Message ID 20200302043520.14165-4-andreas.rheinhardt@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel,1/17] avformat: Use correct error in case muxer is not found | expand

Checks

Context Check Description
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Andreas Rheinhardt March 2, 2020, 4:35 a.m. UTC
ff_alloc_extradata() already sets the size of the extradata so doing it
again is unnecessary.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/segment.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Gyan Doshi March 2, 2020, 5:17 a.m. UTC | #1
On 02-03-2020 10:05 am, Andreas Rheinhardt wrote:
> ff_alloc_extradata() already sets the size of the extradata so doing it
> again is unnecessary.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>   libavformat/segment.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/libavformat/segment.c b/libavformat/segment.c
> index 5f7fe76600..d565183349 100644
> --- a/libavformat/segment.c
> +++ b/libavformat/segment.c
> @@ -882,7 +882,6 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
>                   goto calc_times;
>               }
>               memcpy(st->codecpar->extradata, pkt_extradata, pkt_extradata_size);
> -            st->codecpar->extradata_size = pkt_extradata_size;
>           }
>       }
>   

LGTM.

Gyan
Michael Niedermayer March 2, 2020, 10:38 p.m. UTC | #2
On Mon, Mar 02, 2020 at 10:47:29AM +0530, Gyan Doshi wrote:
> 
> 
> On 02-03-2020 10:05 am, Andreas Rheinhardt wrote:
> >ff_alloc_extradata() already sets the size of the extradata so doing it
> >again is unnecessary.
> >
> >Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> >---
> >  libavformat/segment.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> >diff --git a/libavformat/segment.c b/libavformat/segment.c
> >index 5f7fe76600..d565183349 100644
> >--- a/libavformat/segment.c
> >+++ b/libavformat/segment.c
> >@@ -882,7 +882,6 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
> >                  goto calc_times;
> >              }
> >              memcpy(st->codecpar->extradata, pkt_extradata, pkt_extradata_size);
> >-            st->codecpar->extradata_size = pkt_extradata_size;
> >          }
> >      }
> 
> LGTM.

will apply

thx
diff mbox series

Patch

diff --git a/libavformat/segment.c b/libavformat/segment.c
index 5f7fe76600..d565183349 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -882,7 +882,6 @@  static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
                 goto calc_times;
             }
             memcpy(st->codecpar->extradata, pkt_extradata, pkt_extradata_size);
-            st->codecpar->extradata_size = pkt_extradata_size;
         }
     }