path: root/audio/format.h
diff options
authorwm4 <wm4@nowhere>2018-01-24 00:02:13 +0100
committerKevin Mitchell <>2018-01-25 20:18:32 -0800
commitd36ff64b29031f402184e4946969810e7d9db0e0 (patch)
treee57f501ce20b384d2183af98f3220ddaa4e7d602 /audio/format.h
parent3dd5621cecdd41c86117d70f93a24aede5e50bbc (diff)
audio: fix annyoing af_get_best_sample_formats() definition
The af_get_best_sample_formats() function had an argument of int[AF_FORMAT_COUNT], which is slightly incorrect, because it's 0 terminated and should in theory have AF_FORMAT_COUNT+1 entries. It won't actually write this many formats (since some formats are fundamentally incompatible), but it still feels annoying and incorrect. So fix it, and require that callers pass an AF_FORMAT_COUNT+1 array. Note that the array size has no meaning in C function arguments (just another issue with C static arrays being weird and stupid), so get rid of it completely. Not changing the af_lavcac3enc use, since that is rewritten in another branch anyway.
Diffstat (limited to 'audio/format.h')
1 files changed, 1 insertions, 1 deletions
diff --git a/audio/format.h b/audio/format.h
index 6d6485ff68..8c620226df 100644
--- a/audio/format.h
+++ b/audio/format.h
@@ -69,7 +69,7 @@ int af_fmt_seconds_to_bytes(int format, float seconds, int channels, int sampler
void af_fill_silence(void *dst, size_t bytes, int format);
-void af_get_best_sample_formats(int src_format, int out_formats[AF_FORMAT_COUNT]);
+void af_get_best_sample_formats(int src_format, int *out_formats);
int af_select_best_samplerate(int src_sampelrate, const int *available);
int af_format_sample_alignment(int format);