diff options
-rw-r--r-- | audio/out/ao_lavc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/audio/out/ao_lavc.c b/audio/out/ao_lavc.c index a89324e9b0..09bf8717a6 100644 --- a/audio/out/ao_lavc.c +++ b/audio/out/ao_lavc.c @@ -64,7 +64,7 @@ static bool supports_format(AVCodec *codec, int format) sampleformat && *sampleformat != AV_SAMPLE_FMT_NONE; ++sampleformat) { - if (format && af_from_avformat(*sampleformat) == format) + if (af_from_avformat(*sampleformat) == format) return true; } return false; @@ -75,7 +75,7 @@ static void select_format(struct ao *ao, AVCodec *codec) int formats[AF_FORMAT_COUNT]; af_get_best_sample_formats(ao->format, formats); - for (int n = 0; n < AF_FORMAT_COUNT; n++) { + for (int n = 0; formats[n]; n++) { if (supports_format(codec, formats[n])) { ao->format = formats[n]; break; |