mirror of https://github.com/mpv-player/mpv
audio/format: minor fix for af_fmt_from_planar
See af_fmt_to_planar.
This commit is contained in:
parent
5532a3da1e
commit
4e91cb72ef
|
@ -95,14 +95,16 @@ int af_fmt_to_planar(int format)
|
||||||
|
|
||||||
// Return the interleaved format corresponding to the given format.
|
// Return the interleaved format corresponding to the given format.
|
||||||
// If the format is already interleaved, return it.
|
// 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)
|
int af_fmt_from_planar(int format)
|
||||||
{
|
{
|
||||||
for (int n = 0; n < MP_ARRAY_SIZE(planar_formats); n++) {
|
for (int n = 0; n < MP_ARRAY_SIZE(planar_formats); n++) {
|
||||||
if (planar_formats[n][0] == format)
|
if (planar_formats[n][0] == format)
|
||||||
return planar_formats[n][1];
|
return planar_formats[n][1];
|
||||||
|
if (planar_formats[n][1] == format)
|
||||||
|
return format;
|
||||||
}
|
}
|
||||||
return format;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool af_fmt_is_valid(int format)
|
bool af_fmt_is_valid(int format)
|
||||||
|
|
Loading…
Reference in New Issue