<html><head></head><body>I have to disagree for the simple reason that I don't want to break the LibVLC API again in 5.0 (nor do I want to retain piles of legacy backward compatibility code).<br><br><div class="gmail_quote">Le 20 janvier 2020 12:13:12 GMT+02:00, Thomas Guillem <thomas@gllm.fr> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">So, can I push this patch ? In that case, we could plan a libvlc media_player rework for 5.0 (that will be like the vlc_player one).<br><br>On Thu, Jan 16, 2020, at 16:21, Thomas Guillem wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">After more consideration, I really prefer not changing the LibVLC API <br>again (so, keeping this patch), I explain:<br><br>I really like the new vlc_player API (OK, I wrote it...). Ideally this <br>API should be exposed directly via LibVLC, but we can't really do it <br>since the vlc_player is new and can be modified again (and LibVLC API <br>should not be modified as frequently as CORE API).<br><br>What I propose/would like: add a new LibVLC media_player API for 5.0 <br>(or more) that is a copy of the vlc_player one (directly or via a <br>wrapper). If we do that, we might want to not change the LibVLC API for <br>4.0 since it will change again in 5.0.<br><br>On Thu, Jan 16, 2020, at 16:08, Alexandre Janniaux wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;">Hi,<br><br>I agree against the backward compatibility choice,<br>otherwise we might want to change the function naming to<br>enforce this change.<br><br>It doesn't feel urgent to change this behaviour for VLC 4.0.<br><br>Regards,<br>--<br>Alexandre Janniaux<br>Videolabs<br><br>On Thu, Jan 16, 2020 at 03:02:48PM +0100, Thomas Guillem wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;"> Regression from vlc_player.h port. libvlc_media_player expose the "disable"<br> track. A -1 id is still a good choice to disable a track, cf<br> src/input/es_out.c, a valid i_id can't be negative.<hr>  lib/audio.c        |  7 +++++++<br>  lib/media_player.c | 18 ++++++++++++++++--<br>  lib/video.c        | 14 ++++++++++++++<br>  3 files changed, 37 insertions(+), 2 deletions(-)<br><br> diff --git a/lib/audio.c b/lib/audio.c<br> index aab84cd47a9..8222300707d 100644<br> --- a/lib/audio.c<br> +++ b/lib/audio.c<br> @@ -375,6 +375,13 @@ int libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track )<br>      vlc_player_t *player = p_mi->player;<br>      vlc_player_Lock(player);<br><br> +    if (i_track < 0)<br> +    {<br> +        vlc_player_UnselectTrackCategory(player, AUDIO_ES);<br> +        i_ret = 0;<br> +        goto end;<br> +    }<br> +<br>      size_t count = vlc_player_GetAudioTrackCount(player);<br>      for( size_t i = 0; i < count; i++ )<br>      {<br> diff --git a/lib/media_player.c b/lib/media_player.c<br> index cdb6ba0b8c5..e21ab5c1998 100644<br> --- a/lib/media_player.c<br> +++ b/lib/media_player.c<br> @@ -1671,14 +1671,28 @@ libvlc_track_description_t *<br>                                        enum es_format_category_e cat )<br>  {<br>      vlc_player_t *player = p_mi->player;<br> -    vlc_player_Lock(player);<br><br>      libvlc_track_description_t *ret, **pp = &ret;<br><br> +    /* Add the "Disable" track */<br> +    libvlc_track_description_t *tr = malloc(sizeof (*tr));<br> +    if (unlikely(tr == NULL))<br> +        return NULL;<br> +    tr->i_id = -1;<br> +    tr->psz_name = strdup(_("Disable"));<br> +    if (unlikely(!tr->psz_name))<br> +    {<br> +        free(tr);<br> +        return NULL;<br> +    }<br> +    *pp = tr;<br> +    pp = &tr->p_next;<br> +<br> +    vlc_player_Lock(player);<br>      size_t count = vlc_player_GetTrackCount(player, cat);<br>      for (size_t i = 0; i < count; i++)<br>      {<br> -        libvlc_track_description_t *tr = malloc(sizeof (*tr));<br> +        tr = malloc(sizeof (*tr));<br>          if (unlikely(tr == NULL))<br>          {<br>              libvlc_printerr("Not enough memory");<br> diff --git a/lib/video.c b/lib/video.c<br> index 6f8e6d7f59a..9772945a958 100644<br> --- a/lib/video.c<br> +++ b/lib/video.c<br> @@ -317,6 +317,13 @@ int libvlc_video_set_spu( libvlc_media_player_t *p_mi, int i_spu )<br>      vlc_player_t *player = p_mi->player;<br>      vlc_player_Lock(player);<br><br> +    if (i_spu < 0)<br> +    {<br> +        vlc_player_UnselectTrackCategory(player, SPU_ES);<br> +        i_ret = 0;<br> +        goto end;<br> +    }<br> +<br>      size_t count = vlc_player_GetSubtitleTrackCount(player);<br>      for (size_t i = 0; i < count; i++)<br>      {<br> @@ -488,6 +495,13 @@ int libvlc_video_set_track( libvlc_media_player_t *p_mi, int i_track )<br>      vlc_player_t *player = p_mi->player;<br>      vlc_player_Lock(player);<br><br> +    if (i_track < 0)<br> +    {<br> +        vlc_player_UnselectTrackCategory(player, VIDEO_ES);<br> +        i_ret = 0;<br> +        goto end;<br> +    }<br> +<br>      size_t count = vlc_player_GetVideoTrackCount(player);<br>      for( size_t i = 0; i < count; i++ )<br>      {<br> --<br> 2.20.1<hr> vlc-devel mailing list<br> To unsubscribe or modify your subscription options:<br> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>