From 38b456068a0870c5c96169074c94ef3e9107c4a8 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Tue, 17 Oct 2017 16:07:26 +0200 Subject: [PATCH] Bug 1409272 - P2. Pre-roll vorbis by 80ms when seeking. r=gerald The value by which we pre-roll is inconsequential, so long as we seek to the previous packet than the one we want. So 80ms will do. MozReview-Commit-ID: 8iPOtjReZnb --HG-- extra : rebase_source : 42908c6afc84cf783356fb7311ffe99b4ec76d96 --- dom/media/mediasource/MediaSourceDemuxer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dom/media/mediasource/MediaSourceDemuxer.cpp b/dom/media/mediasource/MediaSourceDemuxer.cpp index 35b9abb8a474..83bc4e1178fa 100644 --- a/dom/media/mediasource/MediaSourceDemuxer.cpp +++ b/dom/media/mediasource/MediaSourceDemuxer.cpp @@ -9,6 +9,7 @@ #include "MediaSourceUtils.h" #include "OpusDecoder.h" #include "SourceBufferList.h" +#include "VorbisDecoder.h" #include "nsPrintfCString.h" #include @@ -307,7 +308,8 @@ MediaSourceTrackDemuxer::MediaSourceTrackDemuxer(MediaSourceDemuxer* aParent, , mManager(aManager) , mReset(true) , mPreRoll(TimeUnit::FromMicroseconds( - OpusDataDecoder::IsOpus(mParent->GetTrackInfo(mType)->mMimeType) + OpusDataDecoder::IsOpus(mParent->GetTrackInfo(mType)->mMimeType) || + VorbisDataDecoder::IsVorbis(mParent->GetTrackInfo(mType)->mMimeType) ? 80000 : mParent->GetTrackInfo(mType)->mMimeType.EqualsLiteral("audio/mp4a-latm") // AAC encoder delay is by default 2112 audio frames.