зеркало из https://github.com/mozilla/gecko-dev.git
Bug 846687 - Set the transport as non-seekable if the server sends Accept-Ranges, but no Content-Length. r=cpearce
This commit is contained in:
Родитель
2067e704b4
Коммит
4e28d37be4
|
@ -1262,10 +1262,10 @@ void MediaDecoder::SetMediaSeekable(bool aMediaSeekable) {
|
|||
|
||||
void MediaDecoder::SetTransportSeekable(bool aTransportSeekable)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
|
||||
MOZ_ASSERT(NS_IsMainThread() || OnDecodeThread());
|
||||
mTransportSeekable = aTransportSeekable;
|
||||
if (mDecoderStateMachine) {
|
||||
ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
|
||||
mDecoderStateMachine->SetTransportSeekable(aTransportSeekable);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -365,6 +365,12 @@ nsresult OggReader::ReadMetadata(VideoInfo* aInfo,
|
|||
LOG(PR_LOG_DEBUG, ("Got Ogg duration from seeking to end %lld", endTime));
|
||||
}
|
||||
mDecoder->GetResource()->EndSeekingForMetadata();
|
||||
} else if (mDecoder->GetMediaDuration() == -1) {
|
||||
// We don't have a duration, and we don't know enough about the resource
|
||||
// to try a seek. Abort trying to get a duration. This happens for example
|
||||
// when the server says it accepts range requests, but does not give us a
|
||||
// Content-Length.
|
||||
mDecoder->SetTransportSeekable(false);
|
||||
}
|
||||
} else {
|
||||
return NS_ERROR_FAILURE;
|
||||
|
|
Загрузка…
Ссылка в новой задаче