[vlc-devel] [PATCH 04/13] player: create a valid vout from start
Thomas Guillem
thomas at gllm.fr
Mon Apr 15 15:50:49 CEST 2019
---
include/vlc_player.h | 4 ++++
src/input/player.c | 5 +++++
2 files changed, 9 insertions(+)
diff --git a/include/vlc_player.h b/include/vlc_player.h
index ad170f3306..bc93f6029d 100644
--- a/include/vlc_player.h
+++ b/include/vlc_player.h
@@ -2613,6 +2613,10 @@ vlc_player_aout_EnableFilter(vlc_player_t *player, const char *name, bool add);
* @warning the returned vout_thread_t * must be released with vout_Release().
* @see vlc_players_cbs.on_vout_list_changed
*
+ * @note If the player was able to load a "vout window" module, the player is
+ * guaranteed to always hold one valid vout (that can be in the started or
+ * stopped state).
+ *
* @param player player instance
* @return a valid vout_thread_t * or NULL, cf. warning
*/
diff --git a/src/input/player.c b/src/input/player.c
index 1cd06ca42b..f157f08959 100644
--- a/src/input/player.c
+++ b/src/input/player.c
@@ -3569,6 +3569,11 @@ vlc_player_New(vlc_object_t *parent,
input_resource_PutAout(player->resource, aout);
}
+ /* Create the vout_thread_t */
+ vout_thread_t *vout = input_resource_GetVout(player->resource, NULL);
+ if (vout != NULL)
+ input_resource_PutVout(player->resource, vout);
+
player->deleting = false;
vlc_player_InitLocks(player);
--
2.20.1
More information about the vlc-devel
mailing list