avmedia/source/qt6/QtPlayer.cxx |   11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

New commits:
commit d7d542b198d4edb3938b69ff31f07c1b2d0d0fb4
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Feb 13 17:16:29 2026 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Fri Feb 13 21:55:56 2026 +0100

    tdf#170681 qt avmedia: Don't fall back to QtFrameGrabber unless enabled
    
    Due to issues with QtFrameGrabber,
    
        commit 08533ca4e2526644b803c40c0c3d3c96f43762af
        Author: Michael Weghorn <[email protected]>
        Date:   Fri May 2 17:52:19 2025 +0200
    
            tdf#166055 avmedia qt: Use GStreamer frame grabber by default
    
    switched from using QtFrameGrabber by default to using
    the Gstreamer-based grabber by default.
    
    Since then, QtFrameGrabber is only used if either
    of these is true:
    
    1) explicitly enabled by setting the
       SAL_VCL_QT_USE_QT_FRAME_GRABBER environment
       variable
    2) no GStreamer-based grabber is returned by
       createPlatformFrameGrabber
    
    The tdf#170681 scenario of dragging and dropping
    an audio-only file from the gallery in Impress
    shows that 2) is also reached then because the
    preferred size of the audio-only file in
    Player::createFrameGrabber is empty, and thus no
    frame grabber is created.
    
    This apparently (at least in some configurations) results in
    the QtFrameGrabber problems like crashes that the
    above-mentioned commit was supposed to avoid,
    until they get addressed a different way.
    
    Therefore, adjust the logic to only create a
    QtFrameGrabber when explicitly enabled, i.e.
    for 1), but no longer for 2).
    
    Change-Id: Ic95303e812819a9c432543992773b334995ddd31
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199356
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Jenkins

diff --git a/avmedia/source/qt6/QtPlayer.cxx b/avmedia/source/qt6/QtPlayer.cxx
index 78ff33ca074b..5118e9bc3e42 100644
--- a/avmedia/source/qt6/QtPlayer.cxx
+++ b/avmedia/source/qt6/QtPlayer.cxx
@@ -287,15 +287,10 @@ uno::Reference<media::XFrameGrabber> SAL_CALL 
QtPlayer::createFrameGrabber()
     // as QtFrameGrabber has issues (see e.g. tdf#166055)
     static const bool bPreferQtFrameGrabber
         = (getenv("SAL_VCL_QT_USE_QT_FRAME_GRABBER") != nullptr);
-    if (!bPreferQtFrameGrabber)
-    {
-        uno::Reference<media::XFrameGrabber> xFrameGrabber
-            = 
createPlatformFrameGrabber(toOUString(m_xMediaPlayer->source().url()));
-        if (xFrameGrabber.is())
-            return xFrameGrabber;
-    }
+    if (bPreferQtFrameGrabber)
+        return new QtFrameGrabber(m_xMediaPlayer->source());
 
-    return new QtFrameGrabber(m_xMediaPlayer->source());
+    return 
createPlatformFrameGrabber(toOUString(m_xMediaPlayer->source().url()));
 }
 
 OUString SAL_CALL QtPlayer::getImplementationName()

Reply via email to