[vlc-devel] metadata in sout

Rafaël Carré rafael.carre at gmail.com
Tue Aug 2 05:22:14 CEST 2011


Le Mon,  1 Aug 2011 23:17:35 -0400,
Rafaël Carré <rafael.carre at gmail.com> a écrit :

> (VLC doesn't write tags in sout it seems).

It should be doable from file access output:

diff --git a/modules/access_output/file.c b/modules/access_output/file.c
index f89d93e..aee441a 100644
--- a/modules/access_output/file.c
+++ b/modules/access_output/file.c
@@ -41,6 +41,8 @@
 #include <vlc_block.h>
 #include <vlc_fs.h>
 #include <vlc_strings.h>
+#include <vlc_url.h>
+#include <vlc_input_item.h>
 
 #if defined( WIN32 ) && !defined( UNDER_CE )
 #   include <io.h>
@@ -193,6 +195,23 @@ static void Close( vlc_object_t * p_this )
 
     close( (intptr_t)p_access->p_sys );
 
+    /* write meta data */
+    char *psz_path = str_format(p_access, p_access->psz_path);
+    if (psz_path) {
+        path_sanitize(psz_path);
+        char *psz_uri = make_URI(psz_path, "file");
+        free(psz_path);
+        if (psz_uri) {
+            input_item_t *p_item = input_item_New(psz_uri, NULL);
+            free(psz_uri);
+            if (p_item) {
+                input_item_SetTitle(p_item, "lol");
+                input_item_WriteMeta( p_this, p_item );
+                vlc_gc_decref(p_item);
+            }
+        }
+    }
+
     msg_Dbg( p_access, "file access output closed" );
 }



Now, how can we forward meta data to this module?


-- 
Rafaël Carré



More information about the vlc-devel mailing list