[vlc-commits] playlist: add DEMUX_BY_EXTENSION_OR_BY_MIMETYPE

Edward Wang git at videolan.org
Sun Oct 27 09:44:38 CET 2013


vlc | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Sun Oct 27 00:39:21 2013 -0400| [d34e44dea5ffc8212630ef7bb3f5fabf7f6ead45] | committer: Rémi Denis-Courmont

playlist: add DEMUX_BY_EXTENSION_OR_BY_MIMETYPE

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d34e44dea5ffc8212630ef7bb3f5fabf7f6ead45
---

 modules/demux/playlist/playlist.h |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/modules/demux/playlist/playlist.h b/modules/demux/playlist/playlist.h
index e6a1af7..9ae6e30 100644
--- a/modules/demux/playlist/playlist.h
+++ b/modules/demux/playlist/playlist.h
@@ -97,6 +97,15 @@ extern input_item_t * GetCurrentItem(demux_t *p_demux);
         return VLC_EGENERIC; \
     STANDARD_DEMUX_INIT_MSG( msg );
 
+#define DEMUX_BY_EXTENSION_OR_MIMETYPE( ext, mime, msg ) \
+    demux_t *p_demux = (demux_t *)p_this; \
+    char* demux_mimetype = stream_ContentType( p_demux->s ); \
+    if(!( demux_IsPathExtension( p_demux, ext ) || (demux_mimetype && !strcasecmp( mime, demux_mimetype )) )) { \
+        free( demux_mimetype ); \
+        return VLC_EGENERIC; \
+    } \
+    free( demux_mimetype ); \
+    STANDARD_DEMUX_INIT_MSG( msg );
 
 #define CHECK_PEEK( zepeek, size ) do { \
     if( stream_Peek( p_demux->s , &zepeek, size ) < size ){ \



More information about the vlc-commits mailing list