Commit 6a10645b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

itml: expand single use macro

parent a61747e2
......@@ -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 ||
......
......@@ -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)
......
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