summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCœur <coeur@gmx.fr>2022-10-23 20:21:37 +0800
committersfan5 <sfan5@live.de>2022-10-23 14:57:24 +0200
commit67260f8aac8dc894399cb8c94e384d1563c0dad4 (patch)
tree4a2cd453440d7f72238242d6c94c67c08eb6e3de
parent395b37b00510502bbedba8afb1772faf404c4876 (diff)
downloadmpv-67260f8aac8dc894399cb8c94e384d1563c0dad4.tar.bz2
mpv-67260f8aac8dc894399cb8c94e384d1563c0dad4.tar.xz
audio/format: fix Type 'struct entry' has incompatible definitions in different translation units
`struct entry` already exists from <search.h>, so the one we declare in audio/format.c needs to be named differently
-rw-r--r--audio/format.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/audio/format.c b/audio/format.c
index 895972bc4d..4441456ede 100644
--- a/audio/format.c
+++ b/audio/format.c
@@ -187,7 +187,7 @@ int af_format_conversion_score(int dst_format, int src_format)
return score;
}
-struct entry {
+struct mp_entry {
int fmt;
int score;
};
@@ -195,7 +195,7 @@ struct entry {
static int cmp_entry(const void *a, const void *b)
{
#define CMP_INT(a, b) (a > b ? 1 : (a < b ? -1 : 0))
- return -CMP_INT(((struct entry *)a)->score, ((struct entry *)b)->score);
+ return -CMP_INT(((struct mp_entry *)a)->score, ((struct mp_entry *)b)->score);
}
// Return a list of sample format compatible to src_format, sorted by order
@@ -207,11 +207,11 @@ static int cmp_entry(const void *a, const void *b)
void af_get_best_sample_formats(int src_format, int *out_formats)
{
int num = 0;
- struct entry e[AF_FORMAT_COUNT + 1];
+ struct mp_entry e[AF_FORMAT_COUNT + 1];
for (int fmt = 1; fmt < AF_FORMAT_COUNT; fmt++) {
int score = af_format_conversion_score(fmt, src_format);
if (score > INT_MIN)
- e[num++] = (struct entry){fmt, score};
+ e[num++] = (struct mp_entry){fmt, score};
}
qsort(e, num, sizeof(e[0]), cmp_entry);
for (int n = 0; n < num; n++)