mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 21:05:36 +00:00
Bug 723860 - Early bail from reader's GetBuffered() if not yet initialized. r=doublec
This commit is contained in:
parent
1665611abc
commit
1fc0488427
@ -505,6 +505,10 @@ nsresult nsGStreamerReader::Seek(PRInt64 aTarget,
|
|||||||
nsresult nsGStreamerReader::GetBuffered(nsTimeRanges* aBuffered,
|
nsresult nsGStreamerReader::GetBuffered(nsTimeRanges* aBuffered,
|
||||||
PRInt64 aStartTime)
|
PRInt64 aStartTime)
|
||||||
{
|
{
|
||||||
|
if (!mInfo.mHasVideo && !mInfo.mHasAudio) {
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
GstFormat format = GST_FORMAT_TIME;
|
GstFormat format = GST_FORMAT_TIME;
|
||||||
MediaResource* resource = mDecoder->GetResource();
|
MediaResource* resource = mDecoder->GetResource();
|
||||||
gint64 resourceLength = resource->GetLength();
|
gint64 resourceLength = resource->GetLength();
|
||||||
|
@ -1532,8 +1532,7 @@ nsresult nsOggReader::GetBuffered(nsTimeRanges* aBuffered, PRInt64 aStartTime)
|
|||||||
{
|
{
|
||||||
// HasAudio and HasVideo are not used here as they take a lock and cause
|
// HasAudio and HasVideo are not used here as they take a lock and cause
|
||||||
// a deadlock. Accessing mInfo doesn't require a lock - it doesn't change
|
// a deadlock. Accessing mInfo doesn't require a lock - it doesn't change
|
||||||
// after metadata is read and GetBuffered isn't called before metadata is
|
// after metadata is read.
|
||||||
// read.
|
|
||||||
if (!mInfo.mHasVideo && !mInfo.mHasAudio) {
|
if (!mInfo.mHasVideo && !mInfo.mHasAudio) {
|
||||||
// No need to search through the file if there are no audio or video tracks
|
// No need to search through the file if there are no audio or video tracks
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -239,6 +239,9 @@ static double RoundToUsecs(double aSeconds) {
|
|||||||
|
|
||||||
nsresult nsWaveReader::GetBuffered(nsTimeRanges* aBuffered, PRInt64 aStartTime)
|
nsresult nsWaveReader::GetBuffered(nsTimeRanges* aBuffered, PRInt64 aStartTime)
|
||||||
{
|
{
|
||||||
|
if (!mInfo.mHasAudio) {
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
PRInt64 startOffset = mDecoder->GetResource()->GetNextCachedData(mWavePCMOffset);
|
PRInt64 startOffset = mDecoder->GetResource()->GetNextCachedData(mWavePCMOffset);
|
||||||
while (startOffset >= 0) {
|
while (startOffset >= 0) {
|
||||||
PRInt64 endOffset = mDecoder->GetResource()->GetCachedDataEnd(startOffset);
|
PRInt64 endOffset = mDecoder->GetResource()->GetCachedDataEnd(startOffset);
|
||||||
|
Loading…
Reference in New Issue
Block a user