Bug 978647 - Properly handle EOF in DirectShow backend. r=edwin

This commit is contained in:
Chris Pearce 2014-03-03 19:57:10 +13:00
parent cd18304a10
commit 1a2bf7e190
2 changed files with 8 additions and 0 deletions

View File

@ -1643,6 +1643,9 @@ public:
void BaseMediaResource::DispatchBytesConsumed(int64_t aNumBytes, int64_t aOffset)
{
if (aNumBytes <= 0) {
return;
}
RefPtr<nsIRunnable> event(new DispatchBytesConsumedEvent(mDecoder, aNumBytes, aOffset));
NS_DispatchToMainThread(event, NS_DISPATCH_NORMAL);
}

View File

@ -84,6 +84,11 @@ ParseMP3Headers(MP3FrameParser *aParser, MediaResource *aResource)
MAX_READ_SIZE, &bytesRead);
NS_ENSURE_SUCCESS(rv, rv);
if (!bytesRead) {
// End of stream.
return NS_ERROR_FAILURE;
}
aParser->Parse(buffer, bytesRead, offset);
offset += bytesRead;
}