Fixes a Clang warning when asserts are disabled: "variable 'quant' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]"
Unified · Split
| @@ -19,6 +19,7 @@ · 18 unmodified lines | ||
| 19 | 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 | 20 | */ |
| 21 | 21 | |
| 22 | +#include "libavutil/avassert.h" | |
| 22 | 23 | #include "libavutil/channel_layout.h" |
| 23 | 24 | #include "avcodec.h" |
| 24 | 25 | #include "bytestream.h" |
| @@ -45,7 +46,7 @@ static av_cold int pcm_dvd_encode_init(AVCodecContext *avctx) · 20 unmodified lines | ||
| 45 | 46 | freq = 1; |
| 46 | 47 | break; |
| 47 | 48 | default: |
| 48 | − av_assert1(0); | |
| 49 | + av_unreachable("Already checked via CODEC_SAMPLERATES"); | |
| 49 | 50 | } |
| 50 | 51 | |
| 51 | 52 | switch (avctx->sample_fmt) { |
| @@ -58,7 +59,7 @@ static av_cold int pcm_dvd_encode_init(AVCodecContext *avctx) · 6 unmodified lines | ||
| 58 | 59 | quant = 2; |
| 59 | 60 | break; |
| 60 | 61 | default: |
| 61 | − av_assert1(0); | |
| 62 | + av_unreachable("Already checked via CODEC_SAMPLEFMTS"); | |
| 62 | 63 | } |
| 63 | 64 | |
| 64 | 65 | avctx->bits_per_coded_sample = 16 + quant * 4; |