<html><head></head><body>At least, the patch perpetuates the underlying problem that zero and unknown are confused.<br><br><div class="gmail_quote">Le 23 juin 2018 09:22:26 GMT+01:00, Steve Lhomme <robux4@ycbcr.xyz> 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">On 2018-06-23 9:53 AM, Rémi Denis-Courmont wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> The duration of vlc://nop is *not* unknown. It's zero.<br></blockquote><br>I don't see why this patches changes that. 0 is a valid value, unlike -1.<br><br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"><br> Le 23 juin 2018 08:26:14 GMT+01:00, Steve Lhomme <robux4@ycbcr.xyz> a <br> écrit :<br><br> Instead of a hardcoded value (which is not VLC_TS_INVALID)<br> ---<br> modules/control/oldrc.c | 2 +-<br> modules/lua/libs/sd.c | 2 +-<br> modules/lua/vlc.c | 2 +-<br> modules/services_discovery/udev.c | 2 +-<br> modules/services_discovery/xcb_apps.c | 2 +-<br> src/playlist/tree.c | 2 +-<br> 6 files changed, 6 insertions(+), 6 deletions(-)<br><br> diff --git a/modules/control/oldrc.c b/modules/control/oldrc.c<br> index 2c9c2728e33..62eeb2061c5 100644<br> --- a/modules/control/oldrc.c<br> +++ b/modules/control/oldrc.c<br> @@ -1156,7 +1156,7 @@ static void print_playlist( intf_thread_t *p_intf, playlist_item_t *p_item, int<br> char psz_buffer[MSTRTIME_MAX_SIZE];<br> for( int i = 0; i< p_item->i_children; i++ )<br> {<br> - if( p_item->pp_children[i]->p_input->i_duration != -1 )<br> + if( p_item->pp_children[i]->p_input->i_duration != INPUT_UNKNOWN_DURATION )<br> {<br> secstotimestr( psz_buffer, p_item->pp_children[i]->p_input->i_duration / CLOCK_FREQ );<br> msg_rc( "|%*s- %s (%s)", 2 * i_level, "", p_item->pp_children[i]->p_input->psz_name, psz_buffer );<br> diff --git a/modules/lua/libs/sd.c b/modules/lua/libs/sd.c<br> index e0e3f91f8a8..72238186c09 100644<br> --- a/modules/lua/libs/sd.c<br> +++ b/modules/lua/libs/sd.c<br> @@ -295,7 +295,7 @@ static input_item_t *vlclua_sd_create_node( services_discovery_t *p_sd,<br> }<br> <br> const char *psz_name = lua_tostring( L, -1 );<br> - input_item_t *p_input = input_item_NewExt( "vlc://nop", psz_name, -1,<br> + input_item_t *p_input = input_item_NewExt( "vlc://nop", psz_name, INPUT_UNKNOWN_DURATION,</blockquote><br><br>And here it says the input item should use -1 which was and still is an <br>invalid/unknown value.<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> ITEM_TYPE_NODE,<br> ITEM_NET_UNKNOWN );<br> lua_pop( L, 1 );<br> diff --git a/modules/lua/vlc.c b/modules/lua/vlc.c<br> index 65631558e64..5dd68cead15 100644<br> --- a/modules/lua/vlc.c<br> +++ b/modules/lua/vlc.c<br> @@ -484,7 +484,7 @@ input_item_t *vlclua_read_input_item(vlc_object_t *obj, lua_State *L)<br> msg_Warn(obj, "Playlist item name should be a string" );<br> <br> /* Read duration */<br> - vlc_tick_t duration = -1;<br> + vlc_tick_t duration = INPUT_UNKNOWN_DURATION;<br> <br> lua_getfield( L, -3, "duration" );<br> if (lua_isnumber(L, -1))<br> diff --git a/modules/services_discovery/udev.c b/modules/services_discovery/udev.c<br> index d297f4708da..504f1f503e6 100644<br> --- a/modules/services_discovery/udev.c<br> +++ b/modules/services_discovery/udev.c<br> @@ -168,7 +168,7 @@ static int AddDevice (services_discovery_t *sd, struct udev_device *dev)<br> if (mrl == NULL)<br> return 0; /* don't know if it was an error... */<br> char *name = p_sys->subsys->get_name (dev);<br> - input_item_t *item = input_item_NewExt (mrl, name ? name : mrl, -1,<br> + input_item_t *item = input_item_NewExt (mrl, name ? name : mrl, INPUT_UNKNOWN_DURATION,<br> p_sys->subsys->item_type, ITEM_LOCAL);<br> msg_Dbg (sd, "adding %s (%s)", mrl, name);<br> free (name);<br> diff --git a/modules/services_discovery/xcb_apps.c b/modules/services_discovery/xcb_apps.c<br> index 659df39384b..570ea98e034 100644<br> --- a/modules/services_discovery/xcb_apps.c<br> +++ b/modules/services_discovery/xcb_apps.c<br> @@ -164,7 +164,7 @@ static int Open (vlc_object_t *obj)<br> }<br> <br> p_sys->apps = NULL;<br> - p_sys->apps_root = input_item_NewExt("vlc://nop", _("Applications"), -1,<br> + p_sys->apps_root = input_item_NewExt("vlc://nop", _("Applications"), INPUT_UNKNOWN_DURATION,<br> ITEM_TYPE_NODE, ITEM_LOCAL);<br> if (likely(p_sys->apps_root != NULL))<br> services_discovery_AddItem(sd, p_sys->apps_root);<br> diff --git a/src/playlist/tree.c b/src/playlist/tree.c<br> index d642ce4bde2..158661440e6 100644<br> --- a/src/playlist/tree.c<br> +++ b/src/playlist/tree.c<br> @@ -66,7 +66,7 @@ playlist_item_t * playlist_NodeCreate( playlist_t *p_playlist,<br> PL_ASSERT_LOCKED;<br> if( !psz_name ) psz_name = _("Undefined");<br> <br> - p_new_input = input_item_NewExt( NULL, psz_name, VLC_TS_INVALID, ITEM_TYPE_NODE,<br> + p_new_input = input_item_NewExt( NULL, psz_name, INPUT_UNKNOWN_DURATION, ITEM_TYPE_NODE,<br> ITEM_NET_UNKNOWN );<br> if( !p_new_input )<br> return NULL;<br><br><br> -- <br> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez <br> excuser ma brièveté.<br><br><br><hr><br> 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><br><hr><br>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>