]> git.sesse.net Git - ffmpeg/commitdiff
libavformat/mux, mxfenc: Don't initialize unnecessarily
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 31 Mar 2020 07:54:11 +0000 (09:54 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 17 Apr 2020 23:24:56 +0000 (01:24 +0200)
When no packet could be output, the interleavement functions
nevertheless initialized the packet destined for output (with the
exception of the data and size fields, making the initialization
pointless), although it will not be used at all. So remove the
initializations.

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/internal.h
libavformat/mux.c
libavformat/mxfenc.c

index 7e4284b21702fc97be088b660c29efc12a6b7aa9..329b2e972d65cbeebe372c0d10a773f358c53833 100644 (file)
@@ -503,8 +503,8 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt);
  * @param pkt the input packet; will be blank on return if not NULL
  * @param flush 1 if no further packets are available as input and all
  *              remaining packets should be output
- * @return 1 if a packet was output, 0 if no packet could be output,
- *         < 0 if an error occurred
+ * @return 1 if a packet was output, 0 if no packet could be output
+ *         (in which case out may be uninitialized), < 0 if an error occurred
  */
 int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out,
                                  AVPacket *pkt, int flush);
index 3d63d59faf1ca627fa15201b58180ffc9119a5fb..a6253f5430bfa2b5f644acadcdd3f769bd2f5591 100644 (file)
@@ -1144,7 +1144,6 @@ int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out,
 
         return 1;
     } else {
-        av_init_packet(out);
         return 0;
     }
 }
index bfce531f5409b67bfbb7614817e10c9dccb9130e..23147e9b84d6af42a5a8db18a3fb60d06b7cb2aa 100644 (file)
@@ -3070,7 +3070,6 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket
         return 1;
     } else {
     out:
-        av_init_packet(out);
         return 0;
     }
 }