aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/matroskaenc.c
diff options
context:
space:
mode:
authorVignesh Venkatasubramanian <vigneshv@google.com>2013-08-16 11:08:06 -0700
committerMichael Niedermayer <michaelni@gmx.at>2013-08-18 00:04:08 +0200
commit571efd972986c857c50f2ddc6e3cfb320f06450f (patch)
tree30d76a13ab31bf12a5009fcf4a7ac2ec6154a465 /libavformat/matroskaenc.c
parent6e4b9b8a2fb52f0deee3f420d553b903532a0444 (diff)
downloadandroid_external_ffmpeg-571efd972986c857c50f2ddc6e3cfb320f06450f.tar.gz
android_external_ffmpeg-571efd972986c857c50f2ddc6e3cfb320f06450f.tar.bz2
android_external_ffmpeg-571efd972986c857c50f2ddc6e3cfb320f06450f.zip
lavf/matroska: Adding the new SeekPreRoll element
In order to encapsuate Opus in Matroska, there is a new element that has been added to the Matroska Spec, SeekPreRoll. It has the duration in nanoseconds that has to be decoded before every seek. Spec: http://matroska.org/technical/specs/index.html#SeekPreRoll Proposal for encapsulateing Opus in Matroska: http://wiki.xiph.org/MatroskaOpus Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/matroskaenc.c')
-rw-r--r--libavformat/matroskaenc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index c201d5e640..18e96c3b11 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -121,6 +121,9 @@ typedef struct MatroskaMuxContext {
/** per-cuepoint - 2 1-byte EBML IDs, 2 1-byte EBML sizes, 8-byte uint max */
#define MAX_CUEPOINT_SIZE(num_tracks) 12 + MAX_CUETRACKPOS_SIZE*num_tracks
+/** Seek preroll value for opus */
+#define OPUS_SEEK_PREROLL 80000000
+
static int ebml_id_size(unsigned int id)
{
@@ -642,6 +645,10 @@ 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);
+ }
+
if (mkv->mode == MODE_WEBM && !(codec->codec_id == AV_CODEC_ID_VP8 ||
codec->codec_id == AV_CODEC_ID_VP9 ||
((codec->codec_id == AV_CODEC_ID_OPUS)&&(codec->strict_std_compliance <= FF_COMPLIANCE_EXPERIMENTAL)) ||