[vlc-commits] itml: expand single use macro
Rémi Denis-Courmont
git at videolan.org
Tue Apr 18 20:55:51 CEST 2017
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Apr 17 19:59:50 2017 +0300| [6a10645bef42262286f5e653053d64b621b661e8] | committer: Rémi Denis-Courmont
itml: expand single use macro
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6a10645bef42262286f5e653053d64b621b661e8
---
modules/demux/playlist/itml.c | 9 +++++++--
modules/demux/playlist/playlist.h | 7 -------
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/modules/demux/playlist/itml.c b/modules/demux/playlist/itml.c
index 68326e4bf2..70fe91c2e5 100644
--- a/modules/demux/playlist/itml.c
+++ b/modules/demux/playlist/itml.c
@@ -51,8 +51,13 @@ static int Demux( demux_t * );
*/
int Import_iTML( vlc_object_t *p_this )
{
- DEMUX_BY_EXTENSION_OR_FORCED_MSG( ".xml", "itml",
- "using iTunes Media Library reader" );
+ demux_t *p_demux = (demux_t *)p_this;
+ CHECK_FILE();
+ if( !demux_IsPathExtension( p_demux, ".xml" )
+ && !demux_IsForced( p_demux, "itml" ) )
+ return VLC_EGENERIC; \
+ STANDARD_DEMUX_INIT_MSG( "using iTunes Media Library reader" );
+
const uint8_t *p_peek;
const ssize_t i_peek = vlc_stream_Peek( p_demux->s, &p_peek, 128 );
if ( i_peek < 32 ||
diff --git a/modules/demux/playlist/playlist.h b/modules/demux/playlist/playlist.h
index c11ee7ef36..c981e78354 100644
--- a/modules/demux/playlist/playlist.h
+++ b/modules/demux/playlist/playlist.h
@@ -97,13 +97,6 @@ do { \
return VLC_EGENERIC; \
STANDARD_DEMUX_INIT_MSG( msg );
-#define DEMUX_BY_EXTENSION_OR_FORCED_MSG( ext, module, msg ) \
- demux_t *p_demux = (demux_t *)p_this; \
- CHECK_FILE(); \
- if( !demux_IsPathExtension( p_demux, ext ) && !demux_IsForced( p_demux, module ) ) \
- return VLC_EGENERIC; \
- STANDARD_DEMUX_INIT_MSG( msg );
-
#define CHECK_PEEK( zepeek, size ) do { \
if( vlc_stream_Peek( p_demux->s , &zepeek, size ) < size ){ \
msg_Dbg( p_demux, "not enough data" ); return VLC_EGENERIC; } } while(0)
More information about the vlc-commits
mailing list