mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 723860 - Early bail from reader's GetBuffered() if not yet initialized. r=doublec
This commit is contained in:
parent
104e9e3e22
commit
d6ea8c2c90
@ -505,6 +505,10 @@ nsresult nsGStreamerReader::Seek(PRInt64 aTarget,
|
||||
nsresult nsGStreamerReader::GetBuffered(nsTimeRanges* aBuffered,
|
||||
PRInt64 aStartTime)
|
||||
{
|
||||
if (!mInfo.mHasVideo && !mInfo.mHasAudio) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
GstFormat format = GST_FORMAT_TIME;
|
||||
MediaResource* resource = mDecoder->GetResource();
|
||||
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
|
||||
// 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
|
||||
// read.
|
||||
// after metadata is read.
|
||||
if (!mInfo.mHasVideo && !mInfo.mHasAudio) {
|
||||
// No need to search through the file if there are no audio or video tracks
|
||||
return NS_OK;
|
||||
|
@ -239,6 +239,9 @@ static double RoundToUsecs(double aSeconds) {
|
||||
|
||||
nsresult nsWaveReader::GetBuffered(nsTimeRanges* aBuffered, PRInt64 aStartTime)
|
||||
{
|
||||
if (!mInfo.mHasAudio) {
|
||||
return NS_OK;
|
||||
}
|
||||
PRInt64 startOffset = mDecoder->GetResource()->GetNextCachedData(mWavePCMOffset);
|
||||
while (startOffset >= 0) {
|
||||
PRInt64 endOffset = mDecoder->GetResource()->GetCachedDataEnd(startOffset);
|
||||
|
Loading…
Reference in New Issue
Block a user