зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1050060 - Update index off main thread; r=edwin
This commit is contained in:
Родитель
ae0690b0eb
Коммит
4f53a7c1a6
|
@ -744,6 +744,18 @@ MP4Reader::Seek(int64_t aTime,
|
||||||
void
|
void
|
||||||
MP4Reader::NotifyDataArrived(const char* aBuffer, uint32_t aLength,
|
MP4Reader::NotifyDataArrived(const char* aBuffer, uint32_t aLength,
|
||||||
int64_t aOffset)
|
int64_t aOffset)
|
||||||
|
{
|
||||||
|
if (NS_IsMainThread()) {
|
||||||
|
MediaTaskQueue* queue =
|
||||||
|
mAudio.mTaskQueue ? mAudio.mTaskQueue : mVideo.mTaskQueue;
|
||||||
|
queue->Dispatch(NS_NewRunnableMethod(this, &MP4Reader::UpdateIndex));
|
||||||
|
} else {
|
||||||
|
UpdateIndex();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MP4Reader::UpdateIndex()
|
||||||
{
|
{
|
||||||
nsTArray<MediaByteRange> ranges;
|
nsTArray<MediaByteRange> ranges;
|
||||||
if (NS_FAILED(mDecoder->GetResource()->GetCachedRanges(ranges))) {
|
if (NS_FAILED(mDecoder->GetResource()->GetCachedRanges(ranges))) {
|
||||||
|
|
|
@ -86,6 +86,7 @@ private:
|
||||||
bool Decode(mp4_demuxer::TrackType aTrack);
|
bool Decode(mp4_demuxer::TrackType aTrack);
|
||||||
void Flush(mp4_demuxer::TrackType aTrack);
|
void Flush(mp4_demuxer::TrackType aTrack);
|
||||||
void DrainComplete(mp4_demuxer::TrackType aTrack);
|
void DrainComplete(mp4_demuxer::TrackType aTrack);
|
||||||
|
void UpdateIndex();
|
||||||
void NotifyResourcesStatusChanged();
|
void NotifyResourcesStatusChanged();
|
||||||
bool IsWaitingOnCodecResource();
|
bool IsWaitingOnCodecResource();
|
||||||
bool IsWaitingOnCDMResource();
|
bool IsWaitingOnCDMResource();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче