aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2006-11-20 20:16:32 +0000
committerAurelien Jacobs <aurel@gnuage.org>2006-11-20 20:16:32 +0000
commit0d6d96329466b78b92adbb9444dba1e75317b347 (patch)
tree2019033b269867516f56e54fc13039b1421c8778 /libavformat
parent1038efd8baaa83cc009207eb1b55ec740297bd5e (diff)
downloadffmpeg-0d6d96329466b78b92adbb9444dba1e75317b347.tar.gz
add support for tta in matroska
Originally committed as revision 7138 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/matroska.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libavformat/matroska.c b/libavformat/matroska.c
index dd9f0625b9..44d07dda08 100644
--- a/libavformat/matroska.c
+++ b/libavformat/matroska.c
@@ -225,6 +225,7 @@ static CodecTags codec_tags[]={
{"A_VORBIS" , CODEC_ID_VORBIS},
{"A_AAC" , CODEC_ID_AAC},
{"A_WAVPACK4" , CODEC_ID_WAVPACK},
+ {"A_TTA1" , CODEC_ID_TTA},
{NULL , CODEC_ID_NONE}
/* TODO: AC3-9/10 (?), Real, Musepack, Quicktime */
};
@@ -2264,6 +2265,23 @@ matroska_read_header (AVFormatContext *s,
}
}
+ else if (codec_id == CODEC_ID_TTA) {
+ MatroskaAudioTrack *audiotrack = (MatroskaAudioTrack *) track;
+ ByteIOContext b;
+ extradata_size = 30;
+ extradata = av_mallocz(extradata_size);
+ if (extradata == NULL)
+ return AVERROR_NOMEM;
+ init_put_byte(&b, extradata, extradata_size, 1,
+ NULL, NULL, NULL, NULL);
+ put_buffer(&b, (uint8_t *) "TTA1", 4);
+ put_le16(&b, 1);
+ put_le16(&b, audiotrack->channels);
+ put_le16(&b, audiotrack->bitdepth);
+ put_le32(&b, audiotrack->samplerate);
+ put_le32(&b, matroska->ctx->duration * audiotrack->samplerate);
+ }
+
else if (codec_id == CODEC_ID_RV10 || codec_id == CODEC_ID_RV20 ||
codec_id == CODEC_ID_RV30 || codec_id == CODEC_ID_RV40) {
extradata_offset = 26;