Bug 226867

Summary: [MSE] When currentTime is a large value, it takes time to process SourceBufferPrivate::evictCodedFrames().
Product: WebKit Reporter: Toshio Ogasawara <toshio.ogasawara>
Component: MediaAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: calvaris, don.olmstead, eric.carlson, ews-watchlist, glenn, jer.noble, philipj, sergio, tomoki.imai, webkit-bug-importer, Yousuke.Kimoto
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch none

Description Toshio Ogasawara 2021-06-09 22:11:46 PDT
SourceBufferPrivate::evictCodedFrames() loops to evict frames in a unit of 30 seconds from MediaTime::zeroTime() to "currentTime - thirtySeconds".
In the case of that currentTime is very large (eg. 180,000,000), evictCodedFrames() loops huge times to complete the eviction process. (in the example, it loops 6,000,000 times.)
To make matters worse, the looping process is executed even if there is no MediaSample to be evicted in a track buffer.
That is a point which should be improved.
Comment 1 Toshio Ogasawara 2021-06-09 23:13:55 PDT
Created attachment 431050 [details]
patch
Comment 2 EWS 2021-06-10 13:50:47 PDT
Committed r278728 (238691@main): <https://commits.webkit.org/238691@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 431050 [details].
Comment 3 Radar WebKit Bug Importer 2021-06-10 13:51:22 PDT
<rdar://problem/79158285>
Comment 4 Toshio Ogasawara 2021-06-13 18:50:18 PDT
Thank you for the review.