mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 604067 - Handle error codes from libvorbis in WebM reader. r=kinetik a=blocking2.0
This commit is contained in:
parent
84e276b818
commit
ba5cd52aca
@ -1405,23 +1405,22 @@ void nsBuiltinDecoderStateMachine::LoadMetadata()
|
||||
mDecoder->GetMonitor().AssertCurrentThreadIn();
|
||||
|
||||
LOG(PR_LOG_DEBUG, ("Loading Media Headers"));
|
||||
|
||||
nsresult res;
|
||||
{
|
||||
MonitorAutoExit exitMon(mDecoder->GetMonitor());
|
||||
mReader->ReadMetadata();
|
||||
res = mReader->ReadMetadata();
|
||||
}
|
||||
mDecoder->StartProgressUpdates();
|
||||
const nsVideoInfo& info = mReader->GetInfo();
|
||||
|
||||
mGotDurationFromMetaData = (GetDuration() != -1);
|
||||
|
||||
if (!info.mHasVideo && !info.mHasAudio) {
|
||||
if (NS_FAILED(res) || (!info.mHasVideo && !info.mHasAudio)) {
|
||||
mState = DECODER_STATE_SHUTDOWN;
|
||||
nsCOMPtr<nsIRunnable> event =
|
||||
NS_NewRunnableMethod(mDecoder, &nsBuiltinDecoder::DecodeError);
|
||||
NS_DispatchToMainThread(event, NS_DISPATCH_NORMAL);
|
||||
return;
|
||||
}
|
||||
mDecoder->StartProgressUpdates();
|
||||
mGotDurationFromMetaData = (GetDuration() != -1);
|
||||
}
|
||||
|
||||
void nsBuiltinDecoderStateMachine::StartBuffering()
|
||||
|
@ -190,6 +190,8 @@ _TEST_FILES += \
|
||||
bug533822.ogg \
|
||||
bug557094.ogv \
|
||||
bug580982.webm \
|
||||
bug603918.webm \
|
||||
bug604067.webm \
|
||||
chain.ogv \
|
||||
dirac.ogg \
|
||||
split.webm \
|
||||
|
BIN
content/media/test/bug603918.webm
Normal file
BIN
content/media/test/bug603918.webm
Normal file
Binary file not shown.
BIN
content/media/test/bug604067.webm
Normal file
BIN
content/media/test/bug604067.webm
Normal file
Binary file not shown.
@ -197,6 +197,8 @@ var gErrorTests = [
|
||||
{ name:"bug504843.ogv", type:"video/ogg" },
|
||||
{ name:"bug501279.ogg", type:"audio/ogg" },
|
||||
{ name:"bug580982.webm", type:"video/webm" },
|
||||
{ name:"bug603918.webm", type:"video/webm" },
|
||||
{ name:"bug604067.webm", type:"video/webm" },
|
||||
{ name:"bogus.duh", type:"bogus/duh" }
|
||||
];
|
||||
|
||||
|
@ -301,20 +301,20 @@ nsresult nsWebMReader::ReadMetadata()
|
||||
r = vorbis_synthesis_headerin(&mVorbisInfo,
|
||||
&mVorbisComment,
|
||||
&opacket);
|
||||
if (r < 0) {
|
||||
if (r != 0) {
|
||||
Cleanup();
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
r = vorbis_synthesis_init(&mVorbisDsp, &mVorbisInfo);
|
||||
if (r < 0) {
|
||||
if (r != 0) {
|
||||
Cleanup();
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
r = vorbis_block_init(&mVorbisDsp, &mVorbisBlock);
|
||||
if (r < 0) {
|
||||
if (r != 0) {
|
||||
Cleanup();
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user