Commit b77716ee authored by Erwan Tulou's avatar Erwan Tulou

mediadirs: better detection for recorded material

especially, also detect material recorded at the stream filter level
parent 3fade3ab
......@@ -259,8 +259,9 @@ static int onNewFileAdded( vlc_object_t *p_this, char const *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
services_discovery_t *p_sd = p_data;
services_discovery_sys_t *p_sys = p_sd->p_sys;
(void)p_this; (void)psz_var; (void)oldval;
(void)psz_var; (void)oldval;
char* psz_file = newval.psz_string;
if( !psz_file || !*psz_file )
return VLC_EGENERIC;
......@@ -268,6 +269,8 @@ static int onNewFileAdded( vlc_object_t *p_this, char const *psz_var,
char* psz_uri = make_URI( psz_file );
input_item_t* p_item = input_item_New( p_sd, psz_uri, NULL );
if( p_sys->i_type == Picture )
{
if( fileType( p_sd, psz_file ) == Picture )
{
formatSnapshotItem( p_item );
......@@ -275,18 +278,26 @@ static int onNewFileAdded( vlc_object_t *p_this, char const *psz_var,
msg_Dbg( p_sd, "New snapshot added : %s", psz_file );
}
else if( fileType( p_sd, psz_file ) == Audio )
}
else if( p_sys->i_type == Audio )
{
if( fileType( p_sd, psz_file ) == Audio )
{
services_discovery_AddItem( p_sd, p_item, NULL );
msg_Dbg( p_sd, "New recorded audio added : %s", psz_file );
}
else if( fileType( p_sd, psz_file ) == Video )
}
else if( p_sys->i_type == Video )
{
if( fileType( p_sd, psz_file ) == Video ||
fileType( p_sd, psz_file ) == Unknown )
{
services_discovery_AddItem( p_sd, p_item, NULL );
msg_Dbg( p_sd, "New recorded video added : %s", psz_file );
}
}
vlc_gc_decref( p_item );
free( psz_uri );
......
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