Commit 5b093e36 authored by Rafaël Carré's avatar Rafaël Carré

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).
parent abc92903
...@@ -446,7 +446,9 @@ static inline int playlist_Import( playlist_t *p_playlist, const char *psz_file) ...@@ -446,7 +446,9 @@ static inline int playlist_Import( playlist_t *p_playlist, const char *psz_file)
char psz_uri[256+10]; char psz_uri[256+10];
input_item_t *p_input; input_item_t *p_input;
snprintf( psz_uri, 256+9, "file/://%s", psz_file ); 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, playlist_AddInput( p_playlist, p_input, PLAYLIST_APPEND, PLAYLIST_END,
VLC_TRUE, VLC_FALSE ); VLC_TRUE, VLC_FALSE );
input_Read( p_playlist, p_input, VLC_TRUE ); input_Read( p_playlist, p_input, VLC_TRUE );
......
...@@ -761,6 +761,20 @@ static int Init( input_thread_t * p_input ) ...@@ -761,6 +761,20 @@ static int Init( input_thread_t * p_input )
memset( &p_input->p->counters, 0, sizeof( p_input->p->counters ) ); memset( &p_input->p->counters, 0, sizeof( p_input->p->counters ) );
vlc_mutex_init( p_input, &p_input->p->counters.counters_lock ); 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 ) if( !p_input->b_preparsing )
{ {
/* Prepare statistics */ /* Prepare statistics */
......
...@@ -89,7 +89,6 @@ int playlist_Export( playlist_t * p_playlist, const char *psz_filename , ...@@ -89,7 +89,6 @@ int playlist_Export( playlist_t * p_playlist, const char *psz_filename ,
int playlist_MLLoad( playlist_t *p_playlist ) int playlist_MLLoad( playlist_t *p_playlist )
{ {
#if 0
const char *psz_datadir = p_playlist->p_libvlc->psz_datadir; const char *psz_datadir = p_playlist->p_libvlc->psz_datadir;
char *psz_uri = NULL; char *psz_uri = NULL;
input_item_t *p_input; input_item_t *p_input;
...@@ -122,8 +121,9 @@ int playlist_MLLoad( playlist_t *p_playlist ) ...@@ -122,8 +121,9 @@ int playlist_MLLoad( playlist_t *p_playlist )
goto error; goto error;
} }
const char *const psz_option = "meta-file";
p_input = input_ItemNewExt( p_playlist, psz_uri, p_input = input_ItemNewExt( p_playlist, psz_uri,
_("Media Library"), 0, NULL, -1 ); _("Media Library"), 1, &psz_option, -1 );
if( p_input == NULL ) if( p_input == NULL )
goto error; goto error;
...@@ -142,7 +142,6 @@ int playlist_MLLoad( playlist_t *p_playlist ) ...@@ -142,7 +142,6 @@ int playlist_MLLoad( playlist_t *p_playlist )
error: error:
free( psz_uri ); free( psz_uri );
#endif
return VLC_ENOMEM; return VLC_ENOMEM;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment