Revision 0d6d9632

View differences:

libavformat/matroska.c
225 225
    {"A_VORBIS"         , CODEC_ID_VORBIS},
226 226
    {"A_AAC"            , CODEC_ID_AAC},
227 227
    {"A_WAVPACK4"       , CODEC_ID_WAVPACK},
228
    {"A_TTA1"           , CODEC_ID_TTA},
228 229
    {NULL               , CODEC_ID_NONE}
229 230
/* TODO: AC3-9/10 (?), Real, Musepack, Quicktime */
230 231
};
......
2264 2265
                }
2265 2266
            }
2266 2267

  
2268
            else if (codec_id == CODEC_ID_TTA) {
2269
                MatroskaAudioTrack *audiotrack = (MatroskaAudioTrack *) track;
2270
                ByteIOContext b;
2271
                extradata_size = 30;
2272
                extradata = av_mallocz(extradata_size);
2273
                if (extradata == NULL)
2274
                    return AVERROR_NOMEM;
2275
                init_put_byte(&b, extradata, extradata_size, 1,
2276
                              NULL, NULL, NULL, NULL);
2277
                put_buffer(&b, (uint8_t *) "TTA1", 4);
2278
                put_le16(&b, 1);
2279
                put_le16(&b, audiotrack->channels);
2280
                put_le16(&b, audiotrack->bitdepth);
2281
                put_le32(&b, audiotrack->samplerate);
2282
                put_le32(&b, matroska->ctx->duration * audiotrack->samplerate);
2283
            }
2284

  
2267 2285
            else if (codec_id == CODEC_ID_RV10 || codec_id == CODEC_ID_RV20 ||
2268 2286
                     codec_id == CODEC_ID_RV30 || codec_id == CODEC_ID_RV40) {
2269 2287
                extradata_offset = 26;

Also available in: Unified diff