When compiling with newer versions of Go, a compiler warning was generated due to unhandled enumeration values in a switch statement within avcodec.cpp:
avcodec.cpp:417:17: warning: 11 enumeration values not handled in switch: 'AVCOL_SPC_RGB', 'AVCOL_SPC_BT709', 'AVCOL_SPC_UNSPECIFIED'... [-Wswitch]
Solution
This pull request refactors the color space assignment logic in avcodec.cpp. Instead of initializing the colorspace variable to a default value before the switch statement, we now assign the default value in the default case of the switch. This change resolves the compiler warning and improves the clarity of our color space handling logic.
Note, this change does not alter the functional behavior of the color space conversion logic.
When compiling with newer versions of Go, a compiler warning was generated due to unhandled enumeration values in a switch statement within
avcodec.cpp
:Solution
This pull request refactors the color space assignment logic in
avcodec.cpp
. Instead of initializing thecolorspace
variable to a default value before the switch statement, we now assign the default value in thedefault
case of the switch. This change resolves the compiler warning and improves the clarity of our color space handling logic.Note, this change does not alter the functional behavior of the color space conversion logic.