diff options
author | David Conrad <lessen42@gmail.com> | 2007-09-05 00:23:29 +0000 |
---|---|---|
committer | David Conrad <lessen42@gmail.com> | 2007-09-05 00:23:29 +0000 |
commit | 1a302a5c2a891140c640dded168d0956d271b6c4 (patch) | |
tree | 53ab8c9607affce4723c601dfb9e1d533bcd419f /libavformat/matroskaenc.c | |
parent | 6364d534ea21bc0a9da0f5ad0df784fefb045d14 (diff) | |
download | ffmpeg-1a302a5c2a891140c640dded168d0956d271b6c4.tar.gz |
Write wav header if there is no native audio codec ID
Originally committed as revision 10321 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/matroskaenc.c')
-rw-r--r-- | libavformat/matroskaenc.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index cb6cda5c1d..8828de9384 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -421,7 +421,20 @@ static int mkv_write_tracks(AVFormatContext *s) case CODEC_TYPE_AUDIO: put_ebml_uint(pb, MATROSKA_ID_TRACKTYPE, MATROSKA_TRACK_TYPE_AUDIO); - // XXX: A_MS/ACM + if (!native_id) { + offset_t wav_header; + // no mkv-specific ID, use ACM mode + codec->codec_tag = codec_get_tag(codec_wav_tags, codec->codec_id); + if (!codec->codec_tag) { + av_log(s, AV_LOG_ERROR, "no codec id found for stream %d", i); + return -1; + } + + put_ebml_string(pb, MATROSKA_ID_CODECID, MATROSKA_CODEC_ID_AUDIO_ACM); + wav_header = start_ebml_master(pb, MATROSKA_ID_CODECPRIVATE); + put_wav_header(pb, codec); + end_ebml_master(pb, wav_header); + } subinfo = start_ebml_master(pb, MATROSKA_ID_TRACKAUDIO); put_ebml_uint (pb, MATROSKA_ID_AUDIOCHANNELS , codec->channels); put_ebml_float (pb, MATROSKA_ID_AUDIOSAMPLINGFREQ, codec->sample_rate); |