mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1126723 - Bail out of HasLowUndecodedData if we don't have a duration. v1 r=cpearce
GetEstimatedBufferedTimeRanges returns an empty range if the duration is -1.
This commit is contained in:
parent
1fd0c781e1
commit
274d9d277d
@ -2114,6 +2114,13 @@ bool MediaDecoderStateMachine::HasLowUndecodedData(int64_t aUsecs)
|
||||
NS_ASSERTION(mState > DECODER_STATE_DECODING_FIRSTFRAME,
|
||||
"Must have loaded first frame for GetBuffered() to work");
|
||||
|
||||
// If we don't have a duration, GetBuffered is probably not going to produce
|
||||
// a useful buffered range. Return false here so that we don't get stuck in
|
||||
// buffering mode for live streams.
|
||||
if (GetDuration() < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsRefPtr<dom::TimeRanges> buffered = new dom::TimeRanges();
|
||||
nsresult rv = mReader->GetBuffered(buffered.get());
|
||||
NS_ENSURE_SUCCESS(rv, false);
|
||||
|
Loading…
Reference in New Issue
Block a user