diff mbox

[FFmpeg-devel] ffmpeg: Remove deadcode

Message ID 20161226203512.12406-1-michael@niedermayer.cc
State Accepted
Commit a830ab3f3b1dc06dcd565a2145eb6bcbd4fbf381
Headers show

Commit Message

Michael Niedermayer Dec. 26, 2016, 8:35 p.m. UTC
Fixes: CID1396243

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 ffmpeg.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

Comments

compn Dec. 27, 2016, 12:59 p.m. UTC | #1
On Mon, 26 Dec 2016 21:35:12 +0100
Michael Niedermayer <michael@niedermayer.cc> wrote:

> -        int stop_encoding = 0;

it would be nice if the commit message was "ffmpeg: remove stop_encoding
function , it is dead / unused code"

or so, with the function name in the message? easier to grep?

i have not tested patch...

-compn
Michael Niedermayer Dec. 28, 2016, 6:17 p.m. UTC | #2
On Tue, Dec 27, 2016 at 07:59:15AM -0500, compn wrote:
> On Mon, 26 Dec 2016 21:35:12 +0100
> Michael Niedermayer <michael@niedermayer.cc> wrote:
> 
> > -        int stop_encoding = 0;
> 
> it would be nice if the commit message was "ffmpeg: remove stop_encoding
> function , it is dead / unused code"

changed to something similar to this

applied

thx

[...]
diff mbox

Patch

diff --git a/ffmpeg.c b/ffmpeg.c
index ec9da3e6e2..b85c31459c 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1797,7 +1797,6 @@  static void flush_encoders(void)
         OutputStream   *ost = output_streams[i];
         AVCodecContext *enc = ost->enc_ctx;
         OutputFile      *of = output_files[ost->file_index];
-        int stop_encoding = 0;
 
         if (!ost->encoding_needed)
             continue;
@@ -1816,6 +1815,8 @@  static void flush_encoders(void)
 
         for (;;) {
             const char *desc = NULL;
+            AVPacket pkt;
+            int pkt_size;
 
             switch (enc->codec_type) {
             case AVMEDIA_TYPE_AUDIO:
@@ -1828,9 +1829,6 @@  static void flush_encoders(void)
                 av_assert0(0);
             }
 
-            if (1) {
-                AVPacket pkt;
-                int pkt_size;
                 av_init_packet(&pkt);
                 pkt.data = NULL;
                 pkt.size = 0;
@@ -1848,7 +1846,6 @@  static void flush_encoders(void)
                     fprintf(ost->logfile, "%s", enc->stats_out);
                 }
                 if (ret == AVERROR_EOF) {
-                    stop_encoding = 1;
                     break;
                 }
                 if (ost->finished & MUXER_FINISHED) {
@@ -1861,10 +1858,6 @@  static void flush_encoders(void)
                 if (ost->enc_ctx->codec_type == AVMEDIA_TYPE_VIDEO && vstats_filename) {
                     do_video_stats(ost, pkt_size);
                 }
-            }
-
-            if (stop_encoding)
-                break;
         }
     }
 }