[vlc-devel] [PATCH] libvlc: add language and frame rate to libvlc_media_track_info_t

Rafaël Carré funman at videolan.org
Tue Apr 24 00:36:26 CEST 2012


Le 21/04/2012 17:37, XilasZ a écrit :
> From e6a39bfa4bb94d70a1315c1e7322cd9dfc4fb8de Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?S=C3=A9bastien=20Toque?= <xilasz at gmail.com>
> Date: Thu, 12 Apr 2012 19:22:43 +0200
> Subject: [PATCH 3/3] libvlc: add language and frame rate to
>  libvlc_media_track_info_t

Missing ABI bump (in lib/Makefile.am I think)

> ---
>  include/vlc/libvlc_media.h |    3 +++
>  lib/media.c                |    3 +++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/include/vlc/libvlc_media.h b/include/vlc/libvlc_media.h
> index 279a29c..577e363 100644
> --- a/include/vlc/libvlc_media.h
> +++ b/include/vlc/libvlc_media.h
> @@ -164,9 +164,12 @@ typedef struct libvlc_media_track_info_t
>              /* Video specific */
>              unsigned    i_height;
>              unsigned    i_width;
> +            float       f_frame_rate;
>          } video;
>      } u;
>  
> +    char *psz_language;
> +
>  } libvlc_media_track_info_t;
>  
>  
> diff --git a/lib/media.c b/lib/media.c
> index 2c01c80..4bc832b 100644
> --- a/lib/media.c
> +++ b/lib/media.c
> @@ -707,6 +707,8 @@ libvlc_media_get_tracks_info( libvlc_media_t *p_md, libvlc_media_track_info_t **
>          p_mes->i_codec = p_es->i_codec;
>          p_mes->i_id = p_es->i_id;
>  
> +        p_mes->psz_language = p_es->psz_language != NULL ? strdup(p_es->psz_language) : NULL;
> +

How is that field constructed ? We could perhaps give a 2 or 3 letters
code, then we can allocate it an array and we dont need a free

>          p_mes->i_profile = p_es->i_profile;
>          p_mes->i_level = p_es->i_level;
>  
> @@ -720,6 +722,7 @@ libvlc_media_get_tracks_info( libvlc_media_t *p_md, libvlc_media_track_info_t **
>              p_mes->i_type = libvlc_track_video;
>              p_mes->u.video.i_height = p_es->video.i_height;
>              p_mes->u.video.i_width = p_es->video.i_width;
> +            p_mes->u.video.f_frame_rate = p_es->video.i_frame_rate / (float) p_es->video.i_frame_rate_base;

Why not giving the same info than libvlccore ?
i.e. give the frame rate as a fraction, instead of as a float.



More information about the vlc-devel mailing list