diff options
author | Vignesh Venkatasubramanian <vigneshv@google.com> | 2013-08-30 10:52:36 -0700 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-10 01:45:38 +0200 |
commit | d92b1b1babe69268971863649c225e1747358a74 (patch) | |
tree | c92a255b3966c34a2e9802a161a6d5cd633f2a79 /libavformat/matroskaenc.c | |
parent | bb47aa5850c8f31939a978d361c834d1f3a53960 (diff) | |
download | ffmpeg-d92b1b1babe69268971863649c225e1747358a74.tar.gz |
lavf/matroska: Adding support for Opus CodecDelay
In order to represent the codec delay accurately in Matroska, a
new element CodecDelay has been introduced. It contains the
overall delay added by the codec in nanoseconds. This patch adds
support for muxing CodecDelay value in the container.
Matroska spec for CodecDelay element can be found here:
http://matroska.org/technical/specs/index.html#CodecDelay
Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/matroskaenc.c')
-rw-r--r-- | libavformat/matroskaenc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index 973076103a..13523f800f 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -653,7 +653,12 @@ static int mkv_write_tracks(AVFormatContext *s) } if (codec->codec_id == AV_CODEC_ID_OPUS) { + uint64_t codec_delay =av_rescale_q(codec->delay, + (AVRational){1, codec->sample_rate}, + (AVRational){1, 1000000000}); + put_ebml_uint(pb, MATROSKA_ID_CODECDELAY, codec_delay); put_ebml_uint(pb, MATROSKA_ID_SEEKPREROLL, OPUS_SEEK_PREROLL); + } if (mkv->mode == MODE_WEBM && !(codec->codec_id == AV_CODEC_ID_VP8 || |