vlc_input_item: rename INPUT_DURATION_UNKNOWN to INPUT_DURATION_INDEFINITE

For sources with no exact time limits, therefore it should not be used as such.
This commit is contained in:
Steve Lhomme 2018-07-27 10:22:02 +02:00
parent 4cc81c5165
commit 72466c75ec
11 changed files with 14 additions and 11 deletions

View File

@ -128,7 +128,7 @@ struct input_item_t
* it may remain the duration for items like a node/directory */
#define INPUT_DURATION_UNSET VLC_TICK_INVALID
#define INPUT_DURATION_ZERO 0 /* an item with a zero duration */
#define INPUT_DURATION_UNKNOWN (-1) /* an item with no duration (live/continuous source) */
#define INPUT_DURATION_INDEFINITE (-1) /* item with a known indefinite duration (live/continuous source) */
enum input_item_net_type
{

View File

@ -1156,7 +1156,7 @@ static void print_playlist( intf_thread_t *p_intf, playlist_item_t *p_item, int
char psz_buffer[MSTRTIME_MAX_SIZE];
for( int i = 0; i< p_item->i_children; i++ )
{
if( p_item->pp_children[i]->p_input->i_duration != INPUT_DURATION_UNKNOWN )
if( p_item->pp_children[i]->p_input->i_duration != INPUT_DURATION_INDEFINITE )
{
secstotimestr( psz_buffer, p_item->pp_children[i]->p_input->i_duration / CLOCK_FREQ );
msg_rc( "|%*s- %s (%s)", 2 * i_level, "", p_item->pp_children[i]->p_input->psz_name, psz_buffer );

View File

@ -218,7 +218,7 @@ static int ReadDir( stream_t *p_demux, input_item_node_t *p_subitems )
char *psz_artist = NULL;
char *psz_album_art = NULL;
int i_parsed_duration = 0;
vlc_tick_t i_duration = INPUT_DURATION_UNKNOWN;
vlc_tick_t i_duration = INPUT_DURATION_INDEFINITE;
const char**ppsz_options = NULL;
char * (*pf_dup) (const char *) = p_demux->p_sys;
int i_options = 0;

View File

@ -295,7 +295,8 @@ static input_item_t *vlclua_sd_create_node( services_discovery_t *p_sd,
}
const char *psz_name = lua_tostring( L, -1 );
input_item_t *p_input = input_item_NewExt( INPUT_ITEM_URI_NOP, psz_name, INPUT_DURATION_UNKNOWN,
input_item_t *p_input = input_item_NewExt( INPUT_ITEM_URI_NOP, psz_name,
INPUT_DURATION_INDEFINITE,
ITEM_TYPE_NODE,
ITEM_NET_UNKNOWN );
lua_pop( L, 1 );

View File

@ -484,7 +484,7 @@ input_item_t *vlclua_read_input_item(vlc_object_t *obj, lua_State *L)
msg_Warn(obj, "Playlist item name should be a string" );
/* Read duration */
vlc_tick_t duration = INPUT_DURATION_UNKNOWN;
vlc_tick_t duration = INPUT_DURATION_INDEFINITE;
lua_getfield( L, -3, "duration" );
if (lua_isnumber(L, -1))

View File

@ -90,7 +90,7 @@ static int Open (vlc_object_t *obj)
letter = 'A' + drive;
mrl[8] = name[0] = letter;
item = input_item_NewDisc (mrl, name, INPUT_DURATION_UNKNOWN);
item = input_item_NewDisc (mrl, name, INPUT_DURATION_INDEFINITE);
msg_Dbg (sd, "adding %s (%s)", mrl, name);
if (item == NULL)
break;

View File

@ -850,7 +850,7 @@ sap_announce_t *CreateAnnounce( services_discovery_t *p_sd, uint32_t *i_source,
/* Released in RemoveAnnounce */
p_input = input_item_NewStream( p_sap->p_sdp->psz_uri, p_sdp->psz_sessionname,
INPUT_DURATION_UNKNOWN );
INPUT_DURATION_INDEFINITE );
if( unlikely(p_input == NULL) )
{
free( p_sap );

View File

@ -168,7 +168,8 @@ static int AddDevice (services_discovery_t *sd, struct udev_device *dev)
if (mrl == NULL)
return 0; /* don't know if it was an error... */
char *name = p_sys->subsys->get_name (dev);
input_item_t *item = input_item_NewExt (mrl, name ? name : mrl, INPUT_DURATION_UNKNOWN,
input_item_t *item = input_item_NewExt (mrl, name ? name : mrl,
INPUT_DURATION_INDEFINITE,
p_sys->subsys->item_type, ITEM_LOCAL);
msg_Dbg (sd, "adding %s (%s)", mrl, name);
free (name);

View File

@ -880,7 +880,7 @@ namespace
input_item_t *createNewItem(IXML_Element *p_resource)
{
vlc_tick_t i_duration = INPUT_DURATION_UNKNOWN;
vlc_tick_t i_duration = INPUT_DURATION_INDEFINITE;
const char* psz_resource_url = xml_getChildElementValue( p_resource, "res" );
if( !psz_resource_url )
return NULL;

View File

@ -76,7 +76,7 @@ static int Open (vlc_object_t *obj)
continue;
mrl[8] = name[0] = letter;
item = input_item_NewDisc (mrl, name, INPUT_DURATION_UNKNOWN);
item = input_item_NewDisc (mrl, name, INPUT_DURATION_INDEFINITE);
msg_Dbg (sd, "adding %s (%s)", mrl, name);
if (item == NULL)
break;

View File

@ -164,7 +164,8 @@ static int Open (vlc_object_t *obj)
}
p_sys->apps = NULL;
p_sys->apps_root = input_item_NewExt(INPUT_ITEM_URI_NOP, _("Applications"), INPUT_DURATION_UNKNOWN,
p_sys->apps_root = input_item_NewExt(INPUT_ITEM_URI_NOP, _("Applications"),
INPUT_DURATION_INDEFINITE,
ITEM_TYPE_NODE, ITEM_LOCAL);
if (likely(p_sys->apps_root != NULL))
services_discovery_AddItem(sd, p_sys->apps_root);