[vlc-devel] [PATCH] libvlc: add functions libvlc_get_version() and others

Tanguy Krotoff tkrotoff at gmail.com
Sat Mar 29 20:38:40 CET 2008


I used git-send-email and it lacks some comments :p
so this is a small patch to replace old VLC_*() functions to get vlc
version/compiler/changeset infos

Also, I'm trying to modify libvlc_media_instance_stop() from
media_instance.c so that it sends the event
libvlc_MediaInstanceReachedEnd

I guess it is not good to use input_Control( p_input_thread,
INPUT_SET_STATE, END_S ); since the input thread is being destroyed.
So I tried:
        libvlc_event_t event;
        event.type = libvlc_MediaInstanceReachedEnd;
        libvlc_event_send( p_mi->p_event_manager, &event );

But it crashes inside media_list:

#3  0xb68a4dbf in vlc_pthread_fatal (action=0xb68f3355 "locking
mutex", error=35,
    file=0xb68f4410 "control/media_list.c", line=174) at misc/threads.c:128
#4  0xb68ed385 in libvlc_media_list_release (p_mlist=0x84040e8) at
../include/vlc_threads_funcs.h:116
#5  0xb68ee5a9 in libvlc_media_list_player_next (p_mlp=0x8436c40,
p_e=0x0) at control/media_list_player.c:86
#6  0xb68ee6f5 in media_instance_reached_end (p_event=0xbfc9510c,
p_user_data=0x8436c40)
    at control/media_list_player.c:116
#7  0xb68e7ec0 in libvlc_event_send (p_em=0x844c388,
p_event=0xbfc9510c) at control/event.c:237

And here I'm a bit lost...

I guess the right place for this kind of question is the IRC channel right?

Thx

On Sat, Mar 29, 2008 at 8:28 PM, Tanguy Krotoff <tkrotoff at gmail.com> wrote:
> ---
>   include/vlc/libvlc.h |   27 +++++++++++++++++++++++++++
>   src/Makefile.am      |    1 +
>   src/control/core.c   |   17 +++++++++++++++++
>   3 files changed, 45 insertions(+), 0 deletions(-)
>
>  diff --git a/include/vlc/libvlc.h b/include/vlc/libvlc.h
>  index a626df0..7e00fb2 100644
>  --- a/include/vlc/libvlc.h
>  +++ b/include/vlc/libvlc.h
>  @@ -145,6 +145,33 @@ VLC_PUBLIC_API void libvlc_release( libvlc_instance_t * );
>   */
>   VLC_PUBLIC_API void libvlc_retain( libvlc_instance_t * );
>
>  +/**
>  + * Retrieve libvlc version.
>  + *
>  + * Example: "0.9.0-git Grishenko"
>  + *
>  + * \return a string containing the libvlc version
>  + */
>  +VLC_PUBLIC_API const char * libvlc_get_version();
>  +
>  +/**
>  + * Retrieve libvlc compiler version.
>  + *
>  + * Example: "gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu6)"
>  + *
>  + * \return a string containing the libvlc compiler version
>  + */
>  +VLC_PUBLIC_API const char * libvlc_get_compiler();
>  +
>  +/**
>  + * Retrieve libvlc changeset.
>  + *
>  + * Example: "aa9bce0bc4"
>  + *
>  + * \return a string containing the libvlc changeset
>  + */
>  +VLC_PUBLIC_API const char * libvlc_get_changeset();
>  +
>   /** @}*/
>
>   /*****************************************************************************
>  diff --git a/src/Makefile.am b/src/Makefile.am
>  index f690d1c..ca0bb08 100644
>  --- a/src/Makefile.am
>  +++ b/src/Makefile.am
>  @@ -185,6 +185,7 @@ libvlc_la_LIBADD = `$(VLC_CONFIG) -libs libvlc` $(AM_LIBADD) $(LTLIBINTL)
>   libvlc_la_DEPENDENCIES = libvlc.sym
>
>   libvlc_control_la_SOURCES = $(SOURCES_libvlc_control)
>  +nodist_libvlc_control_la_SOURCES = misc/revision.c
>   libvlc_control_la_LIBADD = libvlc.la
>   libvlc_control_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc`
>   libvlc_control_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0
>  diff --git a/src/control/core.c b/src/control/core.c
>  index 08f550b..dffbd2f 100644
>  --- a/src/control/core.c
>  +++ b/src/control/core.c
>  @@ -20,6 +20,7 @@
>   * along with this program; if not, write to the Free Software
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
>   *****************************************************************************/
>  +
>   #include "libvlc_internal.h"
>   #include <vlc/libvlc.h>
>
>  @@ -173,3 +174,19 @@ int libvlc_get_vlc_id( libvlc_instance_t *p_instance )
>   {
>      return p_instance->p_libvlc_int->i_object_id;
>   }
>  +
>  +const char * libvlc_get_version()
>  +{
>  +    return VERSION_MESSAGE;
>  +}
>  +
>  +const char * libvlc_get_compiler()
>  +{
>  +    return VLC_COMPILER;
>  +}
>  +
>  +extern const char psz_vlc_changeset[];
>  +const char * libvlc_get_changeset()
>  +{
>  +    return psz_vlc_changeset;
>  +}
>  --
>  1.5.4.3
>
>



-- 
Tanguy Krotoff <tkrotoff at gmail.com>
+33 6 68 42 70 24



More information about the vlc-devel mailing list