* m3u.c: indentation fix.
const char *psz_name = NULL;
char **ppsz_options = NULL;
int i_options = 0;
+ mtime_t i_duration = -1;
/* Read path and name */
psz_path = lua_tostring( p_state, t+3 );
psz_name = psz_path;
}
+ /* Read duration */
+ lua_getfield( p_state, t+2, "duration" );
+ if( lua_isnumber( p_state, t+5 ) )
+ {
+ i_duration = (mtime_t)lua_tointeger( p_state, t+5 );
+ i_duration *= 1000000;
+ }
+ lua_pop( p_state, 1 ); /* pop "duration" */
+
/* Read options */
lua_getfield( p_state, t+2, "options" );
if( lua_istable( p_state, t+5 ) )
p_input = input_ItemNewExt( p_playlist, psz_path,
psz_name, i_options,
(const char **)ppsz_options,
- -1 );
+ i_duration );
lua_pop( p_state, 1 ); /* pop "name" */
/* Read meta data */
i_options, ppsz_options, i_duration );
if ( psz_artist && *psz_artist )
input_ItemAddInfo( p_input, _(VLC_META_INFO_CAT),
- _(VLC_META_ARTIST), "%s", psz_artist );
+ _(VLC_META_ARTIST), "%s", psz_artist );
playlist_BothAddInput( p_playlist, p_input, p_item_in_category,
PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
PLAYLIST_END, NULL, NULL, VLC_FALSE );
.trackid: the item's TrackID (OPTIONAL, meta data)
.options: a list of VLC options (OPTIONAL)
example: .options = { "fullscreen" }
+ .duration: stream duration in seconds (OPTIONAL)
Invalid playlist items will be discarded by VLC.
VLC defines a global vlc object with the following members: