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.
This commit is contained in:
wm4 2019-09-27 21:21:34 +02:00
parent 22252432e2
commit 53e3cb968a
3 changed files with 8 additions and 0 deletions

View File

@ -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},

View File

@ -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";

View File

@ -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,