[FFmpeg-devel] [PATCH] avformat/matroska: Add support for A_ATRAC/AT1

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Fri Aug 4 20:31:09 EEST 2023


Andreas Rheinhardt:
> asivery:
>> Signed-off-by: asivery <asivery at protonmail.com>
>> ---
>> libavformat/matroska.c | 1 +
>> libavformat/matroskadec.c | 2 ++
>> 2 files changed, 3 insertions(+)
>>
>> diff --git a/libavformat/matroska.c b/libavformat/matroska.c
>> index 90d94b65bf..37305a523c 100644
>> --- a/libavformat/matroska.c
>> +++ b/libavformat/matroska.c
>> @@ -55,6 +55,7 @@ const CodecTags ff_mkv_codec_tags[]={
>> {"A_REAL/ATRC" , AV_CODEC_ID_ATRAC3},
>> {"A_REAL/COOK" , AV_CODEC_ID_COOK},
>> {"A_REAL/SIPR" , AV_CODEC_ID_SIPR},
>> + {"A_ATRAC/AT1" , AV_CODEC_ID_ATRAC1},
>> {"A_TRUEHD" , AV_CODEC_ID_TRUEHD},
>> {"A_TTA1" , AV_CODEC_ID_TTA},
>> {"A_VORBIS" , AV_CODEC_ID_VORBIS},
>> diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
>> index d582f566a2..0aa8e6f3b3 100644
>> --- a/libavformat/matroskadec.c
>> +++ b/libavformat/matroskadec.c
>> @@ -2795,6 +2795,8 @@ static int matroska_parse_tracks(AVFormatContext *s)
>> track->audio.frame_size);
>> if (!track->audio.buf)
>> return AVERROR(ENOMEM);
>> + } else if (codec_id == AV_CODEC_ID_ATRAC1) {
>> + st->codecpar->block_align = track->audio.channels * 212; /* Constant ATRAC frame size */
>> } else if (codec_id == AV_CODEC_ID_FLAC && track->codec_priv.size) {
>> ret = matroska_parse_flac(s, track, &extradata_offset);
>> if (ret < 0)
>> --
>> 2.34.1
> 
> This patch is broken. The indentation is off.
> 
> - Andreas
> 

Apart from this: The result of the multiplication may not fit into an
int; looking at the other atrac1 code it seems that we only support mono
and stereo files. Is this a limitation of FFmpeg or of the format?

- Andreas



More information about the ffmpeg-devel mailing list