[vlc-commits] qt: PlayerController: simplify getVout()

Thomas Guillem git at videolan.org
Fri May 10 09:51:40 CEST 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Apr 15 14:37:18 2019 +0200| [114ddf51d8d734ccf734ca900951d1b5e2539caa] | committer: Thomas Guillem

qt: PlayerController: simplify getVout()

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=114ddf51d8d734ccf734ca900951d1b5e2539caa
---

 modules/gui/qt/components/player_controller.cpp | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/modules/gui/qt/components/player_controller.cpp b/modules/gui/qt/components/player_controller.cpp
index 0e02189b79..e42f7b5b9d 100644
--- a/modules/gui/qt/components/player_controller.cpp
+++ b/modules/gui/qt/components/player_controller.cpp
@@ -1193,16 +1193,10 @@ PlayerController::VoutPtr PlayerController::getVout()
 {
     Q_D(PlayerController);
     vlc_player_locker lock{ d->m_player };
-    size_t count = 0;
-    vout_thread_t** vouts = vlc_player_vout_HoldAll( d->m_player, &count );
-    if( count == 0 || vouts == NULL )
+    vout_thread_t* vout = vlc_player_vout_Hold( d->m_player );
+    if( vout == NULL )
         return VoutPtr{};
-    //add a reference
-    VoutPtr first_vout{vouts[0], true};
-    for( size_t i = 0; i < count; i++ )
-        vout_Release(vouts[i]);
-    free( vouts );
-    return first_vout;
+    return VoutPtr{vout, false};
 }
 
 void PlayerController::setFullscreen( bool new_val )



More information about the vlc-commits mailing list