From 53e3cb968aa669c16dff738653d1e9821cd02c01 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 27 Sep 2019 21:21:34 +0200 Subject: audio: add support for AV_SAMPLE_FMT_S64* What an idiotic format. It makes no sense, and should have been converted to S32 in the demuxer, rather than plague everyone with another extremely obscure nonsense format. Why doesn't ffmpeg add S24 instead? That's an actually useful format. May cause compilation failure with old FFmpeg or Libav libs, but I don't care. --- audio/fmt-conversion.c | 2 ++ audio/format.c | 4 ++++ audio/format.h | 2 ++ 3 files changed, 8 insertions(+) (limited to 'audio') diff --git a/audio/fmt-conversion.c b/audio/fmt-conversion.c index e1c35bba2a..d72a50d2e6 100644 --- a/audio/fmt-conversion.c +++ b/audio/fmt-conversion.c @@ -27,12 +27,14 @@ static const struct { {AV_SAMPLE_FMT_U8, AF_FORMAT_U8}, {AV_SAMPLE_FMT_S16, AF_FORMAT_S16}, {AV_SAMPLE_FMT_S32, AF_FORMAT_S32}, + {AV_SAMPLE_FMT_S64, AF_FORMAT_S64}, {AV_SAMPLE_FMT_FLT, AF_FORMAT_FLOAT}, {AV_SAMPLE_FMT_DBL, AF_FORMAT_DOUBLE}, {AV_SAMPLE_FMT_U8P, AF_FORMAT_U8P}, {AV_SAMPLE_FMT_S16P, AF_FORMAT_S16P}, {AV_SAMPLE_FMT_S32P, AF_FORMAT_S32P}, + {AV_SAMPLE_FMT_S64P, AF_FORMAT_S64P}, {AV_SAMPLE_FMT_FLTP, AF_FORMAT_FLOATP}, {AV_SAMPLE_FMT_DBLP, AF_FORMAT_DOUBLEP}, diff --git a/audio/format.c b/audio/format.c index f56546a207..30bc5ee446 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 4; 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"; diff --git a/audio/format.h b/audio/format.h index 24e1c5404f..bdd4744ae3 100644 --- a/audio/format.h +++ b/audio/format.h @@ -27,6 +27,7 @@ enum af_format { AF_FORMAT_U8, AF_FORMAT_S16, AF_FORMAT_S32, + AF_FORMAT_S64, AF_FORMAT_FLOAT, AF_FORMAT_DOUBLE, @@ -34,6 +35,7 @@ enum af_format { AF_FORMAT_U8P, AF_FORMAT_S16P, AF_FORMAT_S32P, + AF_FORMAT_S64P, AF_FORMAT_FLOATP, AF_FORMAT_DOUBLEP, -- cgit v1.2.3