summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorTom Yan <tom.ty89@gmail.com>2018-07-16 01:17:39 +0800
committersfan5 <sfan5@live.de>2018-08-05 17:51:45 +0200
commit4e91cb72ef926e6a7276c15f6a24549ff62afba8 (patch)
tree553a42a053e4e5104322024396ced6fd1906568c /audio
parent5532a3da1ee058443d3162582b601f19b59377c2 (diff)
downloadmpv-4e91cb72ef926e6a7276c15f6a24549ff62afba8.tar.bz2
mpv-4e91cb72ef926e6a7276c15f6a24549ff62afba8.tar.xz
audio/format: minor fix for af_fmt_from_planar
See af_fmt_to_planar.
Diffstat (limited to 'audio')
-rw-r--r--audio/format.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/audio/format.c b/audio/format.c
index 8a13698ff7..7004409d10 100644
--- a/audio/format.c
+++ b/audio/format.c
@@ -95,14 +95,16 @@ int af_fmt_to_planar(int format)
// Return the interleaved format corresponding to the given format.
// If the format is already interleaved, return it.
-// Always succeeds if format is actually planar; otherwise return 0.
+// Return 0 if there's no equivalent.
int af_fmt_from_planar(int format)
{
for (int n = 0; n < MP_ARRAY_SIZE(planar_formats); n++) {
if (planar_formats[n][0] == format)
return planar_formats[n][1];
+ if (planar_formats[n][1] == format)
+ return format;
}
- return format;
+ return 0;
}
bool af_fmt_is_valid(int format)