History

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.

Niklas Haas committed 1 year ago

Commit 6072e271 parent d9594473 files · +9 −5Browse files

Unified · Split

3 files
  1. libswscale/format.c +1 −1
  2. libswscale/format.h +4 −2
  3. libswscale/graph.h +4 −2
libswscale/format.c+1−1
@@ -483,7 +483,7 @@ static int infer_trc_ref(SwsColor *csp, const SwsColor *ref) · 482 unmodified lines
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+4−2
@@ -21,6 +21,8 @@ · 20 unmodified lines
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) · 102 unmodified lines
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+4−2
@@ -21,6 +21,8 @@ · 20 unmodified lines
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 { · 82 unmodified lines
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;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t