From 4e87ac823108a670a1a0c5f67ab9bcd6980bac33 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 3 Nov 2014 20:00:34 +0100 Subject: demux_mkv: implement audio skipping/trimming This mechanism was introduced for Opus, and allows correct skipping of "preroll" data, as well as discarding trailing audio if the file's length isn't a multiple of the audio frame size. Not sure how to handle seeking. I don't understand the purpose of the SeekPreRoll element. This was tested with correctness_trimming_nobeeps.opus, remuxed to mka with mkvmerge v7.2.0. It seems to be correct, although the reported file duration is incorrect (maybe a mkvmerge issue). --- TOOLS/lib/Parse/Matroska/Definitions.pm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'TOOLS') diff --git a/TOOLS/lib/Parse/Matroska/Definitions.pm b/TOOLS/lib/Parse/Matroska/Definitions.pm index 081fe5bb97..b320e1f6c8 100644 --- a/TOOLS/lib/Parse/Matroska/Definitions.pm +++ b/TOOLS/lib/Parse/Matroska/Definitions.pm @@ -232,6 +232,7 @@ sub define_matroska { elem('Block', 'a1', 'binary'), elem('BlockDuration', '9b', 'uint'), elem('ReferenceBlock*', 'fb', 'sint'), + elem('DiscardPadding', '75A2', 'sint'), }), elem('SimpleBlock*', 'a3', 'binary'), }), @@ -256,6 +257,8 @@ sub define_matroska { elem('CodecPrivate', '63a2', 'binary'), elem('CodecName', '258688', 'str'), elem('CodecDecodeAll', 'aa', 'uint'), + elem('CodecDelay', '56AA', 'uint'), + elem('SeekPreRoll', '56BB', 'uint'), elem('Video', 'e0', { elem('FlagInterlaced', '9a', 'uint'), elem('PixelWidth', 'b0', 'uint'), -- cgit v1.2.3