browser(firefox): do not crash when browser window is minimized (#9951)
This commit is contained in:
parent
49cda3d3df
commit
ddda507ccd
|
|
@ -1,2 +1,2 @@
|
||||||
1301
|
1302
|
||||||
Changed: max@schmitt.mx Mon 1 Nov 2021 16:28:05 CET
|
Changed: yurys@chromium.org Mon 01 Nov 2021 05:04:30 PM PDT
|
||||||
|
|
|
||||||
|
|
@ -159,6 +159,9 @@ class nsScreencastService::Session : public rtc::VideoSinkInterface<webrtc::Vide
|
||||||
void OnRawFrame(uint8_t* videoFrame, size_t videoFrameStride, const webrtc::VideoCaptureCapability& frameInfo) override {
|
void OnRawFrame(uint8_t* videoFrame, size_t videoFrameStride, const webrtc::VideoCaptureCapability& frameInfo) override {
|
||||||
int pageWidth = frameInfo.width - mMargin.LeftRight();
|
int pageWidth = frameInfo.width - mMargin.LeftRight();
|
||||||
int pageHeight = frameInfo.height - mMargin.TopBottom();
|
int pageHeight = frameInfo.height - mMargin.TopBottom();
|
||||||
|
// Frame size is 1x1 when browser window is minimized.
|
||||||
|
if (pageWidth <= 1 || pageHeight <= 1)
|
||||||
|
return;
|
||||||
// Headed Firefox brings sizes in sync slowly.
|
// Headed Firefox brings sizes in sync slowly.
|
||||||
if (mViewportWidth && pageWidth > mViewportWidth)
|
if (mViewportWidth && pageWidth > mViewportWidth)
|
||||||
pageWidth = mViewportWidth;
|
pageWidth = mViewportWidth;
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
1299
|
1300
|
||||||
Changed: max@schmitt.mx Mon 1 Nov 2021 16:28:05 CET
|
Changed: yurys@chromium.org Mon 01 Nov 2021 05:00:33 PM PDT
|
||||||
|
|
|
||||||
|
|
@ -159,6 +159,9 @@ class nsScreencastService::Session : public rtc::VideoSinkInterface<webrtc::Vide
|
||||||
void OnRawFrame(uint8_t* videoFrame, size_t videoFrameStride, const webrtc::VideoCaptureCapability& frameInfo) override {
|
void OnRawFrame(uint8_t* videoFrame, size_t videoFrameStride, const webrtc::VideoCaptureCapability& frameInfo) override {
|
||||||
int pageWidth = frameInfo.width - mMargin.LeftRight();
|
int pageWidth = frameInfo.width - mMargin.LeftRight();
|
||||||
int pageHeight = frameInfo.height - mMargin.TopBottom();
|
int pageHeight = frameInfo.height - mMargin.TopBottom();
|
||||||
|
// Frame size is 1x1 when browser window is minimized.
|
||||||
|
if (pageWidth <= 1 || pageHeight <= 1)
|
||||||
|
return;
|
||||||
// Headed Firefox brings sizes in sync slowly.
|
// Headed Firefox brings sizes in sync slowly.
|
||||||
if (mViewportWidth && pageWidth > mViewportWidth)
|
if (mViewportWidth && pageWidth > mViewportWidth)
|
||||||
pageWidth = mViewportWidth;
|
pageWidth = mViewportWidth;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue