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
This commit is contained in:
Jean-Yves Avenard 2017-10-17 16:07:26 +02:00
Родитель 85eb08473d
Коммит 38b456068a
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -9,6 +9,7 @@
#include "MediaSourceUtils.h"
#include "OpusDecoder.h"
#include "SourceBufferList.h"
#include "VorbisDecoder.h"
#include "nsPrintfCString.h"
#include <algorithm>
@ -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.