[FFmpeg-devel] [PATCH] lavf/matroska: Adding support for Opus CodecDelay

Michael Niedermayer michaelni at gmx.at
Fri Aug 30 02:58:34 CEST 2013


On Thu, Aug 29, 2013 at 12:27:52PM -0700, Vignesh Venkatasubramanian wrote:
> 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 at google.com>
> ---
>  libavformat/matroska.h    | 1 +
>  libavformat/matroskaenc.c | 5 +++++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/libavformat/matroska.h b/libavformat/matroska.h
> index 7cf423c..2c72d3e 100644
> --- a/libavformat/matroska.h
> +++ b/libavformat/matroska.h
> @@ -91,6 +91,7 @@
>  #define MATROSKA_ID_CODECINFOURL 0x3B4040
>  #define MATROSKA_ID_CODECDOWNLOADURL 0x26B240
>  #define MATROSKA_ID_CODECDECODEALL 0xAA
> +#define MATROSKA_ID_CODECDELAY 0x56AA
>  #define MATROSKA_ID_SEEKPREROLL 0x56BB
>  #define MATROSKA_ID_TRACKNAME  0x536E
>  #define MATROSKA_ID_TRACKLANGUAGE 0x22B59C
> diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
> index 92df6cb..70e793b 100644
> --- a/libavformat/matroskaenc.c
> +++ b/libavformat/matroskaenc.c
> @@ -649,6 +649,11 @@ static int mkv_write_tracks(AVFormatContext *s)
>  
>          if (codec->codec_id == AV_CODEC_ID_OPUS) {
>              put_ebml_uint(pb, MATROSKA_ID_SEEKPREROLL, OPUS_SEEK_PREROLL);
> +            uint64_t codec_delay =av_rescale_q(codec->delay,

mixed declaration and code (some compilers dont like that)

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130830/a13abfde/attachment.asc>


More information about the ffmpeg-devel mailing list