diff mbox series

[FFmpeg-devel,2/6] ffmpeg: change vsync value to an enum

Message ID 20211204174118.19085-2-anton@khirnov.net
State Accepted
Commit 011114f3e1593a2397871632937a2c23a1402efe
Headers show
Series [FFmpeg-devel,1/6] ffmpeg: drop useless framerate assignments
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Anton Khirnov Dec. 4, 2021, 5:41 p.m. UTC
Stop explicitly defining VSCFR and DROP values, which were never
documented.
---
 fftools/ffmpeg.c     |  3 ++-
 fftools/ffmpeg.h     | 16 +++++++++-------
 fftools/ffmpeg_opt.c |  2 +-
 3 files changed, 12 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 1814941266..b1549a1096 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -1142,7 +1142,8 @@  static void do_video_out(OutputFile *of,
                          OutputStream *ost,
                          AVFrame *next_picture)
 {
-    int ret, format_video_sync;
+    int ret;
+    enum VideoSyncMethod format_video_sync;
     AVPacket *pkt = ost->pkt;
     AVCodecContext *enc = ost->enc_ctx;
     AVRational frame_rate;
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index cc7ba9bdca..83e37cbed7 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -47,12 +47,14 @@ 
 
 #include "libswresample/swresample.h"
 
-#define VSYNC_AUTO       -1
-#define VSYNC_PASSTHROUGH 0
-#define VSYNC_CFR         1
-#define VSYNC_VFR         2
-#define VSYNC_VSCFR       0xfe
-#define VSYNC_DROP        0xff
+enum VideoSyncMethod {
+    VSYNC_AUTO = -1,
+    VSYNC_PASSTHROUGH,
+    VSYNC_CFR,
+    VSYNC_VFR,
+    VSYNC_VSCFR,
+    VSYNC_DROP,
+};
 
 #define MAX_STREAMS 1024    /* arbitrary sanity check value */
 
@@ -605,7 +607,7 @@  extern float dts_error_threshold;
 
 extern int audio_volume;
 extern int audio_sync_method;
-extern int video_sync_method;
+extern enum VideoSyncMethod video_sync_method;
 extern float frame_drop_threshold;
 extern int do_benchmark;
 extern int do_benchmark_all;
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 6c2eb53290..585e1018a3 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -146,7 +146,7 @@  float dts_error_threshold   = 3600*30;
 
 int audio_volume      = 256;
 int audio_sync_method = 0;
-int video_sync_method = VSYNC_AUTO;
+enum VideoSyncMethod video_sync_method = VSYNC_AUTO;
 float frame_drop_threshold = 0;
 int do_benchmark      = 0;
 int do_benchmark_all  = 0;