Bug 1044498 - Return a null decoder when CreateSubDecoder is called in Shutdown state. r=cajbir

This commit is contained in:
Matthew Gregan 2014-08-27 12:45:05 +12:00
parent 19b195a222
commit f43aa33f3f

View File

@ -344,6 +344,9 @@ CreateReaderForType(const nsACString& aType, AbstractMediaDecoder* aDecoder)
already_AddRefed<SourceBufferDecoder> already_AddRefed<SourceBufferDecoder>
MediaSourceReader::CreateSubDecoder(const nsACString& aType) MediaSourceReader::CreateSubDecoder(const nsACString& aType)
{ {
if (IsShutdown()) {
return nullptr;
}
MOZ_ASSERT(GetTaskQueue()); MOZ_ASSERT(GetTaskQueue());
nsRefPtr<SourceBufferDecoder> decoder = nsRefPtr<SourceBufferDecoder> decoder =
new SourceBufferDecoder(new SourceBufferResource(aType), mDecoder); new SourceBufferDecoder(new SourceBufferResource(aType), mDecoder);