Reland "[MediaRecorder] Fix corrupted video problem with pause/resume spamming."
This reverts commit 5f6e2aac. Reason for revert: roll-forward with invalidatino fix and test. Original change's description: > Revert "[MediaRecorder] Fix corrupted video problem with pause/resume spamming." > > This reverts commit b7dab9dc. > > Reason for revert: caused crbug.com/1065827 which is more severe. > > Original change's description: > > [MediaRecorder] Fix corrupted video problem with pause/resume spamming. > > > > > > This CL fixes an issue caused by the following sequence of events: > > 1. MediaRecorderHandler::Pause(): recording_ = false > > 2. MediaRecorderHandler::WriteData(): if (!recording_) return > > > > The problem is that the WriteData() invocation was decided to > > happen while the recorder was still resumed. In that state, wholes > > would be produced which are not tolerated by vpx_encoder, which > > interprets those as corrupted. > > > > The fix reverts the semantic of the code to when the class was not under > > oilpan and would require manual memory management and restores the > > "invalidation" semantic from when the class was using a weak ptr. > > In fact, the weak reference would be invalidated hence making the > > callbacks no-ops. To keep the same semantic, this CL introduces a > > boolean and avoids overloading the meaning of 'recording_' > > > > This should also not require calling Pause() in Stop(), as all callbacks > > will not do anything after Stop() is called. > > > > Fixed: 1060358 > > Change-Id: I88b0aeb10fd13034412f3689648cebd1df40d6bf > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2106072 > > Commit-Queue: Armando Miraglia <armax@chromium.org> > > Reviewed-by: Markus Handell <handellm@google.com> > > Cr-Commit-Position: refs/heads/master@{#752838} > > TBR=armax@chromium.org,handellm@google.com > > # Not skipping CQ checks because original CL landed > 1 day ago. > > Change-Id: Id8a148253433576469cd7958addf48afdabf44eb > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2128070 > Reviewed-by: Armando Miraglia <armax@chromium.org> > Commit-Queue: Armando Miraglia <armax@chromium.org> > Cr-Commit-Position: refs/heads/master@{#754872} TBR=armax@chromium.org,handellm@google.com Change-Id: Ie1becac31f0f1a2e5aea92bc59e7e356a2c6e62b No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2129534Reviewed-by:Armando Miraglia <armax@chromium.org> Reviewed-by:
Guido Urdaneta <guidou@chromium.org> Commit-Queue: Armando Miraglia <armax@chromium.org> Cr-Commit-Position: refs/heads/master@{#755294}
Showing
Please register or sign in to comment