Skip to content

Commit 6072e27

Browse files
committed
swscale/graph: prefer bools to ints
This is more consistent with the rest of the newly added code, which universally switched to using bools for boolean values.
1 parent d959447 commit 6072e27

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

libswscale/format.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ static int infer_trc_ref(SwsColor *csp, const SwsColor *ref)
483483
return 1;
484484
}
485485

486-
int ff_infer_colors(SwsColor *src, SwsColor *dst)
486+
bool ff_infer_colors(SwsColor *src, SwsColor *dst)
487487
{
488488
int incomplete = 0;
489489

libswscale/format.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#ifndef SWSCALE_FORMAT_H
2222
#define SWSCALE_FORMAT_H
2323

24+
#include <stdbool.h>
25+
2426
#include "libavutil/csp.h"
2527
#include "libavutil/pixdesc.h"
2628

@@ -129,7 +131,7 @@ static inline int ff_fmt_align(enum AVPixelFormat fmt)
129131

130132
int ff_test_fmt(const SwsFormat *fmt, int output);
131133

132-
/* Returns 1 if the formats are incomplete, 0 otherwise */
133-
int ff_infer_colors(SwsColor *src, SwsColor *dst);
134+
/* Returns true if the formats are incomplete, false otherwise */
135+
bool ff_infer_colors(SwsColor *src, SwsColor *dst);
134136

135137
#endif /* SWSCALE_FORMAT_H */

libswscale/graph.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#ifndef SWSCALE_GRAPH_H
2222
#define SWSCALE_GRAPH_H
2323

24+
#include <stdbool.h>
25+
2426
#include "libavutil/slicethread.h"
2527
#include "swscale.h"
2628
#include "format.h"
@@ -109,8 +111,8 @@ typedef struct SwsGraph {
109111
SwsContext *ctx;
110112
AVSliceThread *slicethread;
111113
int num_threads; /* resolved at init() time */
112-
int incomplete; /* set during init() if formats had to be inferred */
113-
int noop; /* set during init() if the graph is a no-op */
114+
bool incomplete; /* set during init() if formats had to be inferred */
115+
bool noop; /* set during init() if the graph is a no-op */
114116

115117
/** Sorted sequence of filter passes to apply */
116118
SwsPass **passes;

0 commit comments

Comments
 (0)