0011-libvlc-media-list-player-add-getter-player-instance.patch 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. From 98b46970488758b32361f7f7a6581d0930927da4 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
  3. Date: Thu, 10 Sep 2015 13:43:36 +0200
  4. Subject: [PATCH 11/13] libvlc media list player: add getter player instance
  5. ---
  6. include/vlc/libvlc_media_list_player.h | 10 ++++++++++
  7. lib/libvlc.sym | 1 +
  8. lib/media_list_player.c | 16 +++++++++++++++-
  9. 3 files changed, 26 insertions(+), 1 deletion(-)
  10. diff --git a/include/vlc/libvlc_media_list_player.h b/include/vlc/libvlc_media_list_player.h
  11. index b85981d..71e2ac0 100644
  12. --- a/include/vlc/libvlc_media_list_player.h
  13. +++ b/include/vlc/libvlc_media_list_player.h
  14. @@ -103,6 +103,16 @@ LIBVLC_API void
  15. libvlc_media_player_t * p_mi );
  16. /**
  17. + * Get media player instance in this media_list_player instance.
  18. + *
  19. + * \param p_mlp media list player instance
  20. + * \return p_mi media player instance
  21. + * \note the caller is responsible for releasing the player instance
  22. + */
  23. +LIBVLC_API libvlc_media_player_t *
  24. + libvlc_media_list_player_get_media_player(libvlc_media_list_player_t * p_mlp);
  25. +
  26. +/**
  27. * Set the media list associated with the player
  28. *
  29. * \param p_mlp media list player instance
  30. diff --git a/lib/libvlc.sym b/lib/libvlc.sym
  31. index 06c9826..97b153b 100644
  32. --- a/lib/libvlc.sym
  33. +++ b/lib/libvlc.sym
  34. @@ -109,6 +109,7 @@ libvlc_media_list_lock
  35. libvlc_media_list_media
  36. libvlc_media_list_new
  37. libvlc_media_list_player_event_manager
  38. +libvlc_media_list_player_get_media_player
  39. libvlc_media_list_player_get_state
  40. libvlc_media_list_player_is_playing
  41. libvlc_media_list_player_new
  42. diff --git a/lib/media_list_player.c b/lib/media_list_player.c
  43. index 44f75a0..b5a645e 100644
  44. --- a/lib/media_list_player.c
  45. +++ b/lib/media_list_player.c
  46. @@ -1,10 +1,12 @@
  47. /*****************************************************************************
  48. * media_list_player.c: libvlc new API media_list player functions
  49. *****************************************************************************
  50. - * Copyright (C) 2007 VLC authors and VideoLAN
  51. + * Copyright (C) 2007-2015 VLC authors and VideoLAN
  52. * $Id$
  53. *
  54. * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
  55. + * Niles Bindel <zaggal69 # gmail.com>
  56. + * Rémi Denis-Courmont
  57. *
  58. * This program is free software; you can redistribute it and/or modify it
  59. * under the terms of the GNU Lesser General Public License as published by
  60. @@ -601,6 +603,18 @@ void libvlc_media_list_player_set_media_player(libvlc_media_list_player_t * p_ml
  61. }
  62. /**************************************************************************
  63. + * get_media_player (Public)
  64. + **************************************************************************/
  65. +libvlc_media_player_t * libvlc_media_list_player_get_media_player(libvlc_media_list_player_t * p_mlp)
  66. +{
  67. + if (p_mlp->p_mi == NULL)
  68. + return NULL;
  69. +
  70. + libvlc_media_player_retain(p_mlp->p_mi);
  71. + return p_mlp->p_mi;
  72. +}
  73. +
  74. +/**************************************************************************
  75. * set_media_list (Public)
  76. **************************************************************************/
  77. void libvlc_media_list_player_set_media_list(libvlc_media_list_player_t * p_mlp, libvlc_media_list_t * p_mlist)
  78. --
  79. 2.5.1