]> git.sesse.net Git - vlc/blobdiff - modules/services_discovery/mediadirs.c
Actually receive frame data and send it on.
[vlc] / modules / services_discovery / mediadirs.c
index 9f911519386484351a5cd5ab632e1655f72fd46a..63f9cb7110e9fdf9b3ae1234d16d80b154a5dfcb 100644 (file)
@@ -190,7 +190,7 @@ static void *Run( void *data )
             !S_ISDIR( st.st_mode ) )
             continue;
 
-        char* psz_uri = make_URI( psz_dir );
+        char* psz_uri = make_URI( psz_dir, "file" );
 
         input_item_t* p_root = input_item_New( p_sd, psz_uri, NULL );
         if( p_sys->i_type == Picture )
@@ -258,6 +258,8 @@ static void input_item_subitem_added( const vlc_event_t * p_event,
 static int onNewFileAdded( vlc_object_t *p_this, char const *psz_var,
                      vlc_value_t oldval, vlc_value_t newval, void *p_data )
 {
+    (void)p_this;
+
     services_discovery_t *p_sd = p_data;
     services_discovery_sys_t *p_sys = p_sd->p_sys;
 
@@ -266,7 +268,7 @@ static int onNewFileAdded( vlc_object_t *p_this, char const *psz_var,
     if( !psz_file || !*psz_file )
         return VLC_EGENERIC;
 
-    char* psz_uri = make_URI( psz_file );
+    char* psz_uri = make_URI( psz_file, "file" );
     input_item_t* p_item = input_item_New( p_sd, psz_uri, NULL );
 
     if( p_sys->i_type == Picture )
@@ -310,33 +312,12 @@ void formatSnapshotItem( input_item_t *p_item )
     if( !p_item )
         return;
 
-    char* psz_file = NULL;
-    char* psz_option = NULL;
     char* psz_uri = input_item_GetURI( p_item );
 
-    if( !psz_uri )
-        goto end;
-
     /* copy the snapshot mrl as a ArtURL */
-    input_item_SetArtURL( p_item, psz_uri );
-
-    psz_file = make_path( psz_uri );
-    if( !psz_file )
-        goto end;
-
-    if( asprintf( &psz_option, "fake-file=%s", psz_file ) == -1 )
-    {
-        psz_option = NULL;
-        goto end;
-    }
-
-    /* display still image as a video */
-    input_item_SetURI( p_item, "fake://" );
-    input_item_AddOption( p_item, psz_option, VLC_INPUT_OPTION_TRUSTED );
+    if( psz_uri )
+        input_item_SetArtURL( p_item, psz_uri );
 
-end:
-    free( psz_option );
-    free( psz_file );
     free( psz_uri );
 }