mirror of https://code.videolan.org/videolan/vlc
Adds an input option "meta-file" to be used by input that aren't real inputs (like playlists).
Re-enables media library. Fixes #1047 (nth attempt).
This commit is contained in:
parent
abc92903ea
commit
5b093e36f6
|
@ -446,7 +446,9 @@ static inline int playlist_Import( playlist_t *p_playlist, const char *psz_file)
|
|||
char psz_uri[256+10];
|
||||
input_item_t *p_input;
|
||||
snprintf( psz_uri, 256+9, "file/://%s", psz_file );
|
||||
p_input = input_ItemNewExt( p_playlist, psz_uri, psz_file, 0, NULL, -1 );
|
||||
const char *const psz_option = "meta-file";
|
||||
p_input = input_ItemNewExt( p_playlist, psz_uri, psz_file,
|
||||
1, &psz_option, -1 );
|
||||
playlist_AddInput( p_playlist, p_input, PLAYLIST_APPEND, PLAYLIST_END,
|
||||
VLC_TRUE, VLC_FALSE );
|
||||
input_Read( p_playlist, p_input, VLC_TRUE );
|
||||
|
|
|
@ -761,6 +761,20 @@ static int Init( input_thread_t * p_input )
|
|||
memset( &p_input->p->counters, 0, sizeof( p_input->p->counters ) );
|
||||
vlc_mutex_init( p_input, &p_input->p->counters.counters_lock );
|
||||
|
||||
for( i = 0; i < p_input->p->input.p_item->i_options; i++ )
|
||||
{
|
||||
if( !strncmp( p_input->p->input.p_item->ppsz_options[i], "meta-file", 9 ) )
|
||||
{
|
||||
msg_Dbg( p_input, "Input is a meta file: disabling unneeded options" );
|
||||
var_SetString( p_input, "sout", "" );
|
||||
var_SetBool( p_input, "sout-all", VLC_FALSE );
|
||||
var_SetString( p_input, "input-slave", "" );
|
||||
var_SetInteger( p_input, "input-repeat", 0 );
|
||||
var_SetString( p_input, "sub-file", "" );
|
||||
var_SetBool( p_input, "sub-autodetect-file", VLC_FALSE );
|
||||
}
|
||||
}
|
||||
|
||||
if( !p_input->b_preparsing )
|
||||
{
|
||||
/* Prepare statistics */
|
||||
|
|
|
@ -89,7 +89,6 @@ int playlist_Export( playlist_t * p_playlist, const char *psz_filename ,
|
|||
|
||||
int playlist_MLLoad( playlist_t *p_playlist )
|
||||
{
|
||||
#if 0
|
||||
const char *psz_datadir = p_playlist->p_libvlc->psz_datadir;
|
||||
char *psz_uri = NULL;
|
||||
input_item_t *p_input;
|
||||
|
@ -122,8 +121,9 @@ int playlist_MLLoad( playlist_t *p_playlist )
|
|||
goto error;
|
||||
}
|
||||
|
||||
const char *const psz_option = "meta-file";
|
||||
p_input = input_ItemNewExt( p_playlist, psz_uri,
|
||||
_("Media Library"), 0, NULL, -1 );
|
||||
_("Media Library"), 1, &psz_option, -1 );
|
||||
if( p_input == NULL )
|
||||
goto error;
|
||||
|
||||
|
@ -142,7 +142,6 @@ int playlist_MLLoad( playlist_t *p_playlist )
|
|||
|
||||
error:
|
||||
free( psz_uri );
|
||||
#endif
|
||||
return VLC_ENOMEM;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue