зеркало из https://github.com/mozilla/gecko-dev.git
Bug 675747 - Handle multiple bos pages in a single ogg bitstream. r=doublec
This commit is contained in:
Родитель
80a5672ebf
Коммит
f288cf29c0
|
@ -194,14 +194,17 @@ nsresult nsOggReader::ReadMetadata(nsVideoInfo* aInfo)
|
|||
int serial = ogg_page_serialno(&page);
|
||||
nsOggCodecState* codecState = 0;
|
||||
|
||||
if (ogg_page_bos(&page)) {
|
||||
NS_ASSERTION(!readAllBOS, "We shouldn't encounter another BOS page");
|
||||
if (!ogg_page_bos(&page)) {
|
||||
// We've encountered a non Beginning Of Stream page. No more BOS pages
|
||||
// can follow in this Ogg segment, so there will be no other bitstreams
|
||||
// in the Ogg (unless it's invalid).
|
||||
readAllBOS = PR_TRUE;
|
||||
} else if (!mCodecStates.Get(serial, nsnull)) {
|
||||
// We've not encountered a stream with this serial number before. Create
|
||||
// an nsOggCodecState to demux it, and map that to the nsOggCodecState
|
||||
// in mCodecStates.
|
||||
codecState = nsOggCodecState::Create(&page);
|
||||
|
||||
#ifdef DEBUG
|
||||
PRBool r =
|
||||
#endif
|
||||
mCodecStates.Put(serial, codecState);
|
||||
DebugOnly<PRBool> r = mCodecStates.Put(serial, codecState);
|
||||
NS_ASSERTION(r, "Failed to insert into mCodecStates");
|
||||
bitstreams.AppendElement(codecState);
|
||||
mKnownStreams.AppendElement(serial);
|
||||
|
@ -227,11 +230,6 @@ nsresult nsOggReader::ReadMetadata(nsVideoInfo* aInfo)
|
|||
{
|
||||
mSkeletonState = static_cast<nsSkeletonState*>(codecState);
|
||||
}
|
||||
} else {
|
||||
// We've encountered the a non Beginning Of Stream page. No more
|
||||
// BOS pages can follow in this Ogg segment, so there will be no other
|
||||
// bitstreams in the Ogg (unless it's invalid).
|
||||
readAllBOS = PR_TRUE;
|
||||
}
|
||||
|
||||
mCodecStates.Get(serial, &codecState);
|
||||
|
|
|
@ -207,6 +207,7 @@ _TEST_FILES += \
|
|||
bug604067.webm \
|
||||
chain.ogv \
|
||||
dirac.ogg \
|
||||
multiple-bos.ogg \
|
||||
split.webm \
|
||||
seek.ogv \
|
||||
seek.webm \
|
||||
|
|
|
@ -94,10 +94,10 @@ var gPlayTests = [
|
|||
{ name:"chain.ogv", type:"video/ogg", duration:Number.NaN },
|
||||
{ name:"bug523816.ogv", type:"video/ogg", duration:0.533 },
|
||||
{ name:"bug495129.ogv", type:"video/ogg", duration:2.41 },
|
||||
|
||||
{ name:"bug498380.ogv", type:"video/ogg", duration:0.533 },
|
||||
{ name:"bug495794.ogg", type:"audio/ogg", duration:0.3 },
|
||||
{ name:"bug557094.ogv", type:"video/ogg", duration:0.24 },
|
||||
{ name:"multiple-bos.ogg", type:"video/ogg", duration:0.431 },
|
||||
{ name:"audio-overhang.ogg", type:"audio/ogg", duration:2.3 },
|
||||
{ name:"video-overhang.ogg", type:"audio/ogg", duration:3.966 },
|
||||
|
||||
|
|
Двоичный файл не отображается.
Загрузка…
Ссылка в новой задаче