diff mbox series

[FFmpeg-devel,42/49] fftools/ffmpeg_mux: simplify submit_packet()

Message ID 20220404113037.13070-43-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,01/49] fftools/ffmpeg: drop an obsolete hack | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 fail Make fate failed

Commit Message

Anton Khirnov April 4, 2022, 11:30 a.m. UTC
---
 fftools/ffmpeg_mux.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c
index 37ae61fee8..2cdbd5feef 100644
--- a/fftools/ffmpeg_mux.c
+++ b/fftools/ffmpeg_mux.c
@@ -258,18 +258,14 @@  static int submit_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost)
 {
     int ret;
 
-    if (of->mux->header_written) {
+    if (of->mux->header_written)
         return write_packet(of, ost, pkt);
-    } else {
-        /* the muxer is not initialized yet, buffer the packet */
-        ret = queue_packet(of, ost, pkt);
-        if (ret < 0) {
-            av_packet_unref(pkt);
-            return ret;
-        }
-    }
 
-    return 0;
+    /* the muxer is not initialized yet, buffer the packet */
+    ret = queue_packet(of, ost, pkt);
+    if (ret < 0)
+        av_packet_unref(pkt);
+    return ret;
 }
 
 int of_submit_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int eof)