Revert "[Media Recorder] Fix video freeze on short recording. Fix tab crash on initialize."
This reverts commit 556813c9. Reason for revert: LeakSanitizer detected memory leaks https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8940004334055018640/+/steps/content_unittests__with_patch_/0/logs/VideoTrackRecorderTest.HandlesOnError/0 Original change's description: > [Media Recorder] Fix video freeze on short recording. Fix tab crash on initialize. > > Fixes an issue where VideoTrackRecorder when used in combination with > VEAEncoder and very short recording durations (just 1 frame) would > occasionally hold on to video frames forever, causing frame buffers > from the buffer pool to become permanently blocked, eventually leading > to video capture freezing. > > The cause was a circular ownership that would happen if only 1 frame > is recorded. > > This CL additionally fixes a crash that could happen on initialization > of VEAEncoder. This issue was revealed during testing of the above fix. > Since it is not 100% if this crash was masked by the other issue, and > would only start occurring with the above fix, I am making a fix for that > part of this CL as well. > > The cause for the crash issue was that class VEAEncoder, which uses > RefCountedThreadSafe<>, would post an asynchronous task from its > constructor. If this task would finish executing before the newly > constructed instance was assigned to a scoped_refptr<> by however > called the constructor, the instance would destroy itself, because > of the AddRef() and subsequent Release() done by the posting and > running of the asynchronous task. > > The fix for this is to use a new method Initialize() instead of > posting a task from the constructor. > > Bug: 859610 > Change-Id: I6645aebfaa7659ab0ced0a20fae57eedfb9d84ab > Reviewed-on: https://chromium-review.googlesource.com/1145877 > Commit-Queue: Christian Fremerey <chfremer@chromium.org> > Reviewed-by: Emircan Uysaler <emircan@chromium.org> > Cr-Commit-Position: refs/heads/master@{#577735} TBR=emircan@chromium.org,chfremer@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 859610,867625 Change-Id: If3fed5676c76da0d6b6ef6a041d74c782e87ebf3 Reviewed-on: https://chromium-review.googlesource.com/1150947Reviewed-by:Yoichi Osato <yoichio@chromium.org> Commit-Queue: Yoichi Osato <yoichio@chromium.org> Cr-Commit-Position: refs/heads/master@{#578181}
Showing
Please register or sign in to comment