diff mbox

[FFmpeg-devel,V2,2/3] fftools/ffmpeg: Put the variable declaration at uppper for block.

Message ID 1541769093-31787-3-git-send-email-mypopydev@gmail.com
State Accepted
Commit 3eccf5be9287c111596c46846f899b8f92381249
Headers show

Commit Message

Jun Zhao Nov. 9, 2018, 1:11 p.m. UTC
move the variable declaration at start of upper for block and
remove the redundant brace.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
---
 fftools/ffmpeg.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

Comments

Carl Eugen Hoyos Nov. 9, 2018, 3:10 p.m. UTC | #1
2018-11-09 14:11 GMT+01:00, Jun Zhao <mypopydev@gmail.com>:
> move the variable declaration at start of upper for block and
> remove the redundant brace.

Why?

(You never had to use git blame and were unhappy about the
necessary iterations?)

No objections here, Carl Eugen
Jun Zhao Nov. 12, 2018, 12:42 a.m. UTC | #2
On Fri, Nov 9, 2018 at 11:11 PM Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
>
> 2018-11-09 14:11 GMT+01:00, Jun Zhao <mypopydev@gmail.com>:
> > move the variable declaration at start of upper for block and
> > remove the redundant brace.
>
> Why?
>
> (You never had to use git blame and were unhappy about the
> necessary iterations?)
>
> No objections here, Carl Eugen

I am always confused with this brace and the coding style in this
part, this is the reason why I try to remove the brace.
diff mbox

Patch

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 9dc42f5..68b8e05 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -1196,6 +1196,8 @@  static void do_video_out(OutputFile *of,
   /* duplicates frame if needed */
   for (i = 0; i < nb_frames; i++) {
     AVFrame *in_picture;
+    int forced_keyframe = 0;
+    double pts_time;
     av_init_packet(&pkt);
     pkt.data = NULL;
     pkt.size = 0;
@@ -1213,10 +1215,6 @@  static void do_video_out(OutputFile *of,
     if (!check_recording_time(ost))
         return;
 
-    {
-        int forced_keyframe = 0;
-        double pts_time;
-
         if (enc->flags & (AV_CODEC_FLAG_INTERLACED_DCT | AV_CODEC_FLAG_INTERLACED_ME) &&
             ost->top_field_first >= 0)
             in_picture->top_field_first = !!ost->top_field_first;
@@ -1324,7 +1322,6 @@  static void do_video_out(OutputFile *of,
                 fprintf(ost->logfile, "%s", enc->stats_out);
             }
         }
-    }
     ost->sync_opts++;
     /*
      * For video, number of frames in == number of packets out.