diff mbox series

[FFmpeg-devel,09/10] fftools/ffmpeg, doc/examples/remuxing: Remove redundant av_packet_unref

Message ID 20200331123745.6461-10-andreas.rheinhardt@gmail.com
State New
Headers show
Series libavformat/mux patches
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Andreas Rheinhardt March 31, 2020, 12:37 p.m. UTC
av_interleaved_write_frame() already returns blank packets.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 doc/examples/remuxing.c | 1 -
 fftools/ffmpeg.c        | 1 -
 2 files changed, 2 deletions(-)

Comments

Marton Balint March 31, 2020, 10:20 p.m. UTC | #1
On Tue, 31 Mar 2020, Andreas Rheinhardt wrote:

> av_interleaved_write_frame() already returns blank packets.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
> doc/examples/remuxing.c | 1 -
> fftools/ffmpeg.c        | 1 -
> 2 files changed, 2 deletions(-)
>
> diff --git a/doc/examples/remuxing.c b/doc/examples/remuxing.c
> index 9e4d1031b4..13469d55ef 100644
> --- a/doc/examples/remuxing.c
> +++ b/doc/examples/remuxing.c
> @@ -167,7 +167,6 @@ int main(int argc, char **argv)
>             fprintf(stderr, "Error muxing packet\n");
>             break;
>         }
> -        av_packet_unref(&pkt);
>     }
>
>     av_write_trailer(ofmt_ctx);
> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> index aaaf241314..c088d134de 100644
> --- a/fftools/ffmpeg.c
> +++ b/fftools/ffmpeg.c
> @@ -827,7 +827,6 @@ static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int u
>         main_return_code = 1;
>         close_all_output_streams(ost, MUXER_FINISHED | ENCODER_FINISHED, ENCODER_FINISHED);
>     }
> -    av_packet_unref(pkt);
> }
> 
> static void close_output_stream(OutputStream *ost)
> --

LGTM.

Thanks,
Marton
diff mbox series

Patch

diff --git a/doc/examples/remuxing.c b/doc/examples/remuxing.c
index 9e4d1031b4..13469d55ef 100644
--- a/doc/examples/remuxing.c
+++ b/doc/examples/remuxing.c
@@ -167,7 +167,6 @@  int main(int argc, char **argv)
             fprintf(stderr, "Error muxing packet\n");
             break;
         }
-        av_packet_unref(&pkt);
     }
 
     av_write_trailer(ofmt_ctx);
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index aaaf241314..c088d134de 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -827,7 +827,6 @@  static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int u
         main_return_code = 1;
         close_all_output_streams(ost, MUXER_FINISHED | ENCODER_FINISHED, ENCODER_FINISHED);
     }
-    av_packet_unref(pkt);
 }
 
 static void close_output_stream(OutputStream *ost)