[vlc-devel] [PATCH 1/4] xspf: add MIME detection

Edward Wang edward.c.wang at compdigitec.com
Fri Oct 18 05:04:45 CEST 2013


---
 modules/demux/playlist/xspf.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/modules/demux/playlist/xspf.c b/modules/demux/playlist/xspf.c
index 8606759..b41b36c 100644
--- a/modules/demux/playlist/xspf.c
+++ b/modules/demux/playlist/xspf.c
@@ -84,6 +84,19 @@ static int Demux(demux_t *);
  */
 int Import_xspf(vlc_object_t *p_this)
 {
+    char* mimetype = NULL;
+    {
+        demux_t *p_demux = (demux_t *)p_this;
+
+        mimetype = stream_ContentType( p_demux->s );
+        if( mimetype && !strcmp( "application/xspf+xml", mimetype ) ) {
+            free( mimetype );
+            STANDARD_DEMUX_INIT_MSG( "using XSPF playlist reader" );
+            return VLC_SUCCESS;
+        }
+    }
+    free( mimetype );
+
     DEMUX_BY_EXTENSION_OR_FORCED_MSG(".xspf", "xspf-open",
                                       "using XSPF playlist reader");
     return VLC_SUCCESS;
-- 
1.8.4.rc3




More information about the vlc-devel mailing list