I am looking at whether or not it's worth trying to include the native service discovery functions into my bindings. I have read comments in mailing lists stating that the libvlc services discovery might be quite buggy - but if there are some simple things that can be fixed I would like to try and fix them and submit patches if it looks like it will be worthwhile.
Anyway, immediately I am seeing problems in the "mediadirs" module, but I do not know much at all about the vlc module system so I was hoping for a pointer.
In "mediadirs.c" I have put some debug trace in to try and understand why only the video directory is considered, this is the vlc module description:
Code: Select all
vlc_module_begin ()
set_category( CAT_PLAYLIST )
set_subcategory( SUBCAT_PLAYLIST_SD )
set_shortname( N_("Video") )
set_description( N_("My Videos") )
set_capability( "services_discovery", 0 )
set_callbacks( OpenVideo, Close )
add_shortcut( "video_dir" )
add_submodule ()
set_shortname( N_("Audio") )
set_description( N_("My Music") )
set_capability( "services_discovery", 0 )
set_callbacks( OpenAudio, Close )
add_shortcut( "audio_dir" )
add_submodule ()
set_shortname( N_("Picture") )
set_description( N_("My Pictures") )
set_capability( "services_discovery", 0 )
set_callbacks( OpenPicture, Close )
add_shortcut( "picture_dir" )
VLC_SD_PROBE_SUBMODULE
vlc_module_end ()
Code: Select all
if( p_sys->i_type == Video )
{
p_sys->psz_dir[0] = config_GetUserDir( VLC_VIDEOS_DIR );
p_sys->psz_dir[1] = var_CreateGetString( p_sd, "input-record-path" );
p_sys->psz_var = "record-file";
}
else if( p_sys->i_type == Audio )
{
p_sys->psz_dir[0] = config_GetUserDir( VLC_MUSIC_DIR );
p_sys->psz_dir[1] = var_CreateGetString( p_sd, "input-record-path" );
p_sys->psz_var = "record-file";
}
else if( p_sys->i_type == Picture )
{
p_sys->psz_dir[0] = config_GetUserDir( VLC_PICTURES_DIR );
p_sys->psz_dir[1] = var_CreateGetString( p_sd, "snapshot-path" );
p_sys->psz_var = "snapshot-file";
}
If I swap the ordering of the video and audio so audio is first (i.e. audio is the "main" module), then indeed it does find all of my audio files, but now no video files are found.
So if anyone has any hints that would be appreciated...
I did notice other strange things like different results depending on the order in which I instantiate media discoverers, but that's a problem for another time if I can get anywhere with this.