diff mbox series

[FFmpeg-devel,05/11] avformat/mpjpegdec: Remove redundant initializations

Message ID 20200107135549.22581-5-andreas.rheinhardt@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel,01/11] avformat/avformat: Update AVInputFormat.read_packet documentation | expand

Checks

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

Commit Message

Andreas Rheinhardt Jan. 7, 2020, 1:55 p.m. UTC
The AVPacket destined for a demuxer's output has already been
initialized before it reaches the demuxer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/mpjpegdec.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Marton Balint Feb. 10, 2020, 11:18 p.m. UTC | #1
On Tue, 7 Jan 2020, Andreas Rheinhardt wrote:

> The AVPacket destined for a demuxer's output has already been
> initialized before it reaches the demuxer.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
> libavformat/mpjpegdec.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/libavformat/mpjpegdec.c b/libavformat/mpjpegdec.c
> index 1e2ab0db1a..df2880412d 100644
> --- a/libavformat/mpjpegdec.c
> +++ b/libavformat/mpjpegdec.c
> @@ -331,9 +331,7 @@ static int mpjpeg_read_packet(AVFormatContext *s, AVPacket *pkt)
>         int remaining = 0, len;
>
>         const int read_chunk = 2048;
> -        av_init_packet(pkt);
> -        pkt->data = NULL;
> -        pkt->size = 0;
> +
>         pkt->pos  = avio_tell(s->pb);
>
>         while ((ret = ffio_ensure_seekback(s->pb, read_chunk - remaining)) >= 0 && /* we may need to return as much as all we've read back to the buffer */

Thanks, applied.

Regards,
Marton
diff mbox series

Patch

diff --git a/libavformat/mpjpegdec.c b/libavformat/mpjpegdec.c
index 1e2ab0db1a..df2880412d 100644
--- a/libavformat/mpjpegdec.c
+++ b/libavformat/mpjpegdec.c
@@ -331,9 +331,7 @@  static int mpjpeg_read_packet(AVFormatContext *s, AVPacket *pkt)
         int remaining = 0, len;
 
         const int read_chunk = 2048;
-        av_init_packet(pkt);
-        pkt->data = NULL;
-        pkt->size = 0;
+
         pkt->pos  = avio_tell(s->pb);
 
         while ((ret = ffio_ensure_seekback(s->pb, read_chunk - remaining)) >= 0 && /* we may need to return as much as all we've read back to the buffer */