[vlc-devel] [PATCH 4/4] access/http: Set metadata from ICY headers

Marvin Scholz epirat07 at gmail.com
Wed Nov 1 05:16:36 CET 2017


---
 modules/access/http/access.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/modules/access/http/access.c b/modules/access/http/access.c
index b9390fdc27..b85ad12b59 100644
--- a/modules/access/http/access.c
+++ b/modules/access/http/access.c
@@ -32,6 +32,7 @@
 #include <vlc_keystore.h>
 #include <vlc_plugin.h>
 #include <vlc_url.h>
+#include <vlc_input.h>
 
 #include "connmgr.h"
 #include "resource.h"
@@ -236,6 +237,16 @@ static int Open(vlc_object_t *obj)
     if (metaint > 0)
         config_PutInt(access, "icy-metaint", metaint);
 
+    input_thread_t *input = access->p_input;
+    if (input)
+    {
+        input_item_t *input_item = input_GetItem(input);
+        if (input_item && icy_name)
+            input_item_SetMeta(input_item, vlc_meta_Title, icy_name);
+        if (input_item && icy_genre)
+            input_item_SetMeta(input_item, vlc_meta_Genre, icy_genre);
+    }
+
 
     char *redir = vlc_http_res_get_redirect(sys->resource);
     if (redir != NULL)
-- 
2.13.5 (Apple Git-94)



More information about the vlc-devel mailing list