X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc_demux.h;h=31ab55580669fe043458a597f700132dfecc2007;hb=1374daaa71c4210f2ddab92617cc296f6cbc6542;hp=6af44af48c4080d2edc27e86be072c48579ffb78;hpb=d1ff0bbaaefb5e2eaaa7d4defac744fbba5ecf61;p=vlc diff --git a/include/vlc_demux.h b/include/vlc_demux.h index 6af44af48c..31ab555806 100644 --- a/include/vlc_demux.h +++ b/include/vlc_demux.h @@ -88,12 +88,12 @@ enum demux_query_e /* I. Common queries to access_demux and demux */ /* POSITION double between 0.0 and 1.0 */ DEMUX_GET_POSITION, /* arg1= double * res= */ - DEMUX_SET_POSITION, /* arg1= double res=can fail */ + DEMUX_SET_POSITION, /* arg1= double arg2= bool b_precise res=can fail */ /* LENGTH/TIME in microsecond, 0 if unknown */ DEMUX_GET_LENGTH, /* arg1= int64_t * res= */ DEMUX_GET_TIME, /* arg1= int64_t * res= */ - DEMUX_SET_TIME, /* arg1= int64_t res=can fail */ + DEMUX_SET_TIME, /* arg1= int64_t arg2= bool b_precise res=can fail */ /* TITLE_INFO only if more than 1 title or 1 chapter */ DEMUX_GET_TITLE_INFO, /* arg1=input_title_t*** arg2=int* @@ -151,7 +151,7 @@ enum demux_query_e DEMUX_CAN_SEEK, /* arg1= bool* can fail (assume false)*/ }; -VLC_EXPORT( int, demux_vaControlHelper, ( stream_t *, int64_t i_start, int64_t i_end, int i_bitrate, int i_align, int i_query, va_list args ) ); +VLC_EXPORT( int, demux_vaControlHelper, ( stream_t *, int64_t i_start, int64_t i_end, int64_t i_bitrate, int i_align, int i_query, va_list args ) ); /************************************************************************* * Miscellaneous helpers for demuxers @@ -192,47 +192,10 @@ VLC_EXPORT( void, demux_PacketizerDestroy, ( decoder_t *p_packetizer ) ); #define DEMUX_INIT_COMMON() do { \ p_demux->pf_control = Control; \ p_demux->pf_demux = Demux; \ - MALLOC_ERR( p_demux->p_sys, demux_sys_t ); \ + p_demux->p_sys = malloc( sizeof( demux_sys_t ) ); \ + if( !p_demux->p_sys ) return VLC_ENOMEM;\ memset( p_demux->p_sys, 0, sizeof( demux_sys_t ) ); } while(0) -#define STANDARD_DEMUX_INIT_MSG( msg ) do { \ - DEMUX_INIT_COMMON(); \ - msg_Dbg( p_demux, "%s", msg ); } while(0) - -#define DEMUX_BY_EXTENSION( ext ) \ - demux_t *p_demux = (demux_t *)p_this; \ - if( !demux_IsPathExtension( p_demux, ext ) ) \ - return VLC_EGENERIC; \ - DEMUX_INIT_COMMON(); - -#define DEMUX_BY_EXTENSION_MSG( ext, msg ) \ - demux_t *p_demux = (demux_t *)p_this; \ - if( !demux_IsPathExtension( p_demux, ext ) ) \ - return VLC_EGENERIC; \ - STANDARD_DEMUX_INIT_MSG( msg ); - -#define DEMUX_BY_EXTENSION_OR_FORCED( ext, module ) \ - demux_t *p_demux = (demux_t *)p_this; \ - if( !demux_IsPathExtension( p_demux, ext ) && !demux_IsForced( p_demux, module ) ) \ - return VLC_EGENERIC; \ - DEMUX_INIT_COMMON(); - -#define DEMUX_BY_EXTENSION_OR_FORCED_MSG( ext, module, msg ) \ - demux_t *p_demux = (demux_t *)p_this; \ - if( !demux_IsPathExtension( p_demux, ext ) && !demux_IsForced( p_demux, module ) ) \ - return VLC_EGENERIC; \ - STANDARD_DEMUX_INIT_MSG( msg ); - -#define CHECK_PEEK( zepeek, size ) \ - if( stream_Peek( p_demux->s , &zepeek, size ) < size ){ \ - msg_Dbg( p_demux, "not enough data" ); return VLC_EGENERIC; } - -#define CHECK_PEEK_GOTO( zepeek, size ) \ - if( stream_Peek( p_demux->s , &zepeek, size ) < size ) { \ - msg_Dbg( p_demux, "not enough data" ); goto error; } - -#define POKE( peek, stuff, size ) (strncasecmp( (const char *)peek, stuff, size )==0) - /** * @} */