From: Niklas Haas <[email protected]>
Reset an SwsFormat to its fully unset/invalid state.
---
libswscale/format.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/libswscale/format.h b/libswscale/format.h
index 3b6d745159..be92038f4f 100644
--- a/libswscale/format.h
+++ b/libswscale/format.h
@@ -85,6 +85,20 @@ typedef struct SwsFormat {
SwsColor color;
} SwsFormat;
+static inline void ff_fmt_clear(SwsFormat *fmt)
+{
+ *fmt = (SwsFormat) {
+ .format = AV_PIX_FMT_NONE,
+ .range = AVCOL_RANGE_UNSPECIFIED,
+ .csp = AVCOL_SPC_UNSPECIFIED,
+ .loc = AVCHROMA_LOC_UNSPECIFIED,
+ .color = {
+ .prim = AVCOL_PRI_UNSPECIFIED,
+ .trc = AVCOL_TRC_UNSPECIFIED,
+ },
+ };
+}
+
/**
* This function also sanitizes and strips the input data, removing irrelevant
* fields for certain formats.
--
2.49.0
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".