@@ -418,8 +418,8 @@ void CScreencopyPortal::SSession::initCallbacks() {
418418
419419 if (!PSTREAM) {
420420 Debug::log (TRACE, " [sc] wlrOnBufferDone: no stream" );
421- sharingData.frameCallback .reset ();
422421 sharingData.status = FRAME_NONE;
422+ sharingData.frameCallback .reset ();
423423 return ;
424424 }
425425
@@ -432,10 +432,10 @@ void CScreencopyPortal::SSession::initCallbacks() {
432432 (PSTREAM->pwVideoInfo .size .width != sharingData.frameInfoDMA .w || PSTREAM->pwVideoInfo .size .height != sharingData.frameInfoDMA .h )) {
433433 Debug::log (LOG, " [sc] Incompatible formats, renegotiate stream" );
434434 sharingData.status = FRAME_RENEG;
435- sharingData.frameCallback .reset ();
436435 g_pPortalManager->m_sPortals .screencopy ->m_pPipewire ->updateStreamParam (PSTREAM);
437436 g_pPortalManager->m_sPortals .screencopy ->queueNextShareFrame (this );
438437 sharingData.status = FRAME_NONE;
438+ sharingData.frameCallback .reset ();
439439 return ;
440440 }
441441
@@ -445,14 +445,14 @@ void CScreencopyPortal::SSession::initCallbacks() {
445445 }
446446
447447 if (!PSTREAM->currentPWBuffer ) {
448- sharingData.frameCallback .reset ();
449448 Debug::log (LOG, " [screencopy/pipewire] Out of buffers" );
450449 sharingData.status = FRAME_NONE;
451450 if (sharingData.copyRetries ++ < MAX_RETRIES) {
452451 Debug::log (LOG, " [sc] Retrying screencopy ({}/{})" , sharingData.copyRetries , MAX_RETRIES);
453452 g_pPortalManager->m_sPortals .screencopy ->m_pPipewire ->updateStreamParam (PSTREAM);
454453 g_pPortalManager->m_sPortals .screencopy ->queueNextShareFrame (this );
455454 }
455+ sharingData.frameCallback .reset ();
456456 return ;
457457 }
458458
@@ -533,8 +533,8 @@ void CScreencopyPortal::SSession::initCallbacks() {
533533
534534 if (!PSTREAM) {
535535 Debug::log (TRACE, " [sc] hlOnBufferDone: no stream" );
536- sharingData.windowFrameCallback .reset ();
537536 sharingData.status = FRAME_NONE;
537+ sharingData.windowFrameCallback .reset ();
538538 return ;
539539 }
540540
@@ -547,10 +547,10 @@ void CScreencopyPortal::SSession::initCallbacks() {
547547 (PSTREAM->pwVideoInfo .size .width != sharingData.frameInfoDMA .w || PSTREAM->pwVideoInfo .size .height != sharingData.frameInfoDMA .h )) {
548548 Debug::log (LOG, " [sc] Incompatible formats, renegotiate stream" );
549549 sharingData.status = FRAME_RENEG;
550- sharingData.windowFrameCallback .reset ();
551550 g_pPortalManager->m_sPortals .screencopy ->m_pPipewire ->updateStreamParam (PSTREAM);
552551 g_pPortalManager->m_sPortals .screencopy ->queueNextShareFrame (this );
553552 sharingData.status = FRAME_NONE;
553+ sharingData.windowFrameCallback .reset ();
554554 return ;
555555 }
556556
@@ -560,14 +560,14 @@ void CScreencopyPortal::SSession::initCallbacks() {
560560 }
561561
562562 if (!PSTREAM->currentPWBuffer ) {
563- sharingData.windowFrameCallback .reset ();
564563 Debug::log (LOG, " [screencopy/pipewire] Out of buffers" );
565564 sharingData.status = FRAME_NONE;
566565 if (sharingData.copyRetries ++ < MAX_RETRIES) {
567566 Debug::log (LOG, " [sc] Retrying screencopy ({}/{})" , sharingData.copyRetries , MAX_RETRIES);
568567 g_pPortalManager->m_sPortals .screencopy ->m_pPipewire ->updateStreamParam (PSTREAM);
569568 g_pPortalManager->m_sPortals .screencopy ->queueNextShareFrame (this );
570569 }
570+ sharingData.windowFrameCallback .reset ();
571571 return ;
572572 }
573573
0 commit comments