diff options
Diffstat (limited to 'audio/format.c')
-rw-r--r-- | audio/format.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/audio/format.c b/audio/format.c index f56546a207..4441456ede 100644 --- a/audio/format.c +++ b/audio/format.c @@ -29,6 +29,7 @@ int af_fmt_to_bytes(int format) case AF_FORMAT_U8: return 1; case AF_FORMAT_S16: return 2; case AF_FORMAT_S32: return 4; + case AF_FORMAT_S64: return 8; case AF_FORMAT_FLOAT: return 4; case AF_FORMAT_DOUBLE: return 8; } @@ -69,6 +70,7 @@ static const int planar_formats[][2] = { {AF_FORMAT_U8P, AF_FORMAT_U8}, {AF_FORMAT_S16P, AF_FORMAT_S16}, {AF_FORMAT_S32P, AF_FORMAT_S32}, + {AF_FORMAT_S64P, AF_FORMAT_S64}, {AF_FORMAT_FLOATP, AF_FORMAT_FLOAT}, {AF_FORMAT_DOUBLEP, AF_FORMAT_DOUBLE}, }; @@ -117,11 +119,13 @@ const char *af_fmt_to_str(int format) case AF_FORMAT_U8: return "u8"; case AF_FORMAT_S16: return "s16"; case AF_FORMAT_S32: return "s32"; + case AF_FORMAT_S64: return "s64"; case AF_FORMAT_FLOAT: return "float"; case AF_FORMAT_DOUBLE: return "double"; case AF_FORMAT_U8P: return "u8p"; case AF_FORMAT_S16P: return "s16p"; case AF_FORMAT_S32P: return "s32p"; + case AF_FORMAT_S64P: return "s64p"; case AF_FORMAT_FLOATP: return "floatp"; case AF_FORMAT_DOUBLEP: return "doublep"; case AF_FORMAT_S_AAC: return "spdif-aac"; @@ -183,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; }; @@ -191,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 @@ -203,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++) |