Commit d34e44de authored by Edward Wang's avatar Edward Wang Committed by Rémi Denis-Courmont

playlist: add DEMUX_BY_EXTENSION_OR_BY_MIMETYPE

Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent 12125c6f
......@@ -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 ){ \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment